tools/geom/diagonals.js
function drawUpperTriangle(d, loc) {
      if (d == "r") {
        var first = {x: 50, y: 0};
        var second = {x: 50, y: 50};
      } else {
        var first = {x: 50, y: 0};
        var second = {x: 0, y: 50};
      }
      context.beginPath();
      context.moveTo(loc.x, loc.y);
      context.lineTo(loc.x + first.x, loc.y + first.y);
      context.lineTo(loc.x + second.x, loc.y + second.y);
      context.lineTo(loc.x, loc.y);
      context.lineWidth = 1;
      context.strokeStyle = 'black';
      context.stroke();
      context.fillStyle = fill;
      context.fill();
      context.closePath();
    }
function drawUpperTriangle(d, loc) {
      if (d == "r") {
        var first = {x: 50, y: 0};
        var second = {x: 50, y: 50};
      } else {
        var first = {x: 50, y: 0};
        var second = {x: 0, y: 50};
      }
      context.beginPath();
      context.moveTo(loc.x, loc.y);
      context.lineTo(loc.x + first.x, loc.y + first.y);
      context.lineTo(loc.x + second.x, loc.y + second.y);
      context.lineTo(loc.x, loc.y);
      context.lineWidth = 1;
      context.strokeStyle = 'black';
      context.stroke();
      context.fillStyle = fill;
      context.fill();
      context.closePath();
    }
function drawUpperTriangle ( d , loc ) { if ( d == "r" ) { var first = { x : 50 , y : 0 } ; var second = { x : 50 , y : 50 } ; } else { var first = { x : 50 , y : 0 } ; var second = { x : 0 , y : 50 } ; } context . beginPath ( ) ; context . moveTo ( loc . x , loc . y ) ; context . lineTo ( loc . x + first . x , loc . y + first . y ) ; context . lineTo ( loc . x + second . x , loc . y + second . y ) ; context . lineTo ( loc . x , loc . y ) ; context . lineWidth = 1 ; context . strokeStyle = 'black' ; context . stroke ( ) ; context . fillStyle = fill ; context . fill ( ) ; context . closePath ( ) ; }
draw upper triangle going certain direction at location
draw upper triangle going certain direction at location