<canvas width="600" height="400"></canvas>
<script>
var tela = document.querySelector('canvas');
var pincel = tela.getContext('2d');
function desenhaEsquadro(xa, ya, xc, yc, cor) {
pincel.fillStyle= cor;
pincel.beginPath();
pincel.moveTo(xa, ya);
pincel.lineTo(xa, xc);
pincel.lineTo(xc, yc);
pincel.fill();
pincel.fillStyle= "white";
pincel.beginPath();
pincel.moveTo(xa * 2, ya * 3.5);
pincel.lineTo(xa * 2, xc / 1.142857142857143);
pincel.lineTo(xc / 1.454545454545455, yc / 1.142857142857143);
pincel.fill();
}
desenhaEsquadro(40, 40, 320, 320, "black");
</script>