function drawCompass(angle, col) {
      angle = angle * Math.PI/180;
      var p = [0, 1.1071, Math.PI/4, 2.8198, 3.4633, 7*Math.PI/4 , 5.1760];

      var poly = [
        120+60*Math.sin(angle+p[0]),       120-60*Math.cos(angle+p[0]),
        120+44.7214*Math.sin(angle+p[1]),  120-44.7214*Math.cos(angle+p[1]),
        120+28.2843*Math.sin(angle+p[2]),  120-28.2843*Math.cos(angle+p[2]),
        120+63.2455*Math.sin(angle+p[3]),  120-63.2455*Math.cos(angle+p[3]),
        120+63.2455*Math.sin(angle+p[4]),  120-63.2455*Math.cos(angle+p[4]),
        120+28.2843*Math.sin(angle+p[5]),  120-28.2843*Math.cos(angle+p[5]),
        120+44.7214*Math.sin(angle+p[6]),  120-44.7214*Math.cos(angle+p[6])
      ];
      
      g.setColor(col);
      g.fillPoly(poly);
    }
// takes 16-20ms, will be called twice
takes 16-20ms, will be called twice
takes 16 - 20ms will be called twice
function drawCompass(angle, col) {
      angle = angle * Math.PI/180;
      var p = [0, 1.1071, Math.PI/4, 2.8198, 3.4633, 7*Math.PI/4 , 5.1760];
      var poly = [
        120+60*Math.sin(angle+p[0]),       120-60*Math.cos(angle+p[0]),
        120+44.7214*Math.sin(angle+p[1]),  120-44.7214*Math.cos(angle+p[1]),
        120+28.2843*Math.sin(angle+p[2]),  120-28.2843*Math.cos(angle+p[2]),
        120+63.2455*Math.sin(angle+p[3]),  120-63.2455*Math.cos(angle+p[3]),
        120+63.2455*Math.sin(angle+p[4]),  120-63.2455*Math.cos(angle+p[4]),
        120+28.2843*Math.sin(angle+p[5]),  120-28.2843*Math.cos(angle+p[5]),
        120+44.7214*Math.sin(angle+p[6]),  120-44.7214*Math.cos(angle+p[6])
      ];
      g.setColor(col);
      g.fillPoly(poly);
    }
function drawCompass ( angle , col ) { angle = angle * Math . PI / 180 ; var p = [ 0 , 1.1071 , Math . PI / 4 , 2.8198 , 3.4633 , 7 * Math . PI / 4 , 5.1760 ] ; var poly = [ 120 + 60 * Math . sin ( angle + p [ 0 ] ) , 120 - 60 * Math . cos ( angle + p [ 0 ] ) , 120 + 44.7214 * Math . sin ( angle + p [ 1 ] ) , 120 - 44.7214 * Math . cos ( angle + p [ 1 ] ) , 120 + 28.2843 * Math . sin ( angle + p [ 2 ] ) , 120 - 28.2843 * Math . cos ( angle + p [ 2 ] ) , 120 + 63.2455 * Math . sin ( angle + p [ 3 ] ) , 120 - 63.2455 * Math . cos ( angle + p [ 3 ] ) , 120 + 63.2455 * Math . sin ( angle + p [ 4 ] ) , 120 - 63.2455 * Math . cos ( angle + p [ 4 ] ) , 120 + 28.2843 * Math . sin ( angle + p [ 5 ] ) , 120 - 28.2843 * Math . cos ( angle + p [ 5 ] ) , 120 + 44.7214 * Math . sin ( angle + p [ 6 ] ) , 120 - 44.7214 * Math . cos ( angle + p [ 6 ] ) ] ; g . setColor ( col ) ; g . fillPoly ( poly ) ; }
takes 16-20ms, will be called twice
takes 16 - 20ms will be called twice