<canvas width="800" height="600"></canvas>
<script>
function criaTriangulo(xa, ya, xc, yc, cor){
var tela = document.querySelector('canvas');
var pincel = tela.getContext('2d');
pincel.fillStyle = cor;
pincel.beginPath();
pincel.moveTo(xa, ya);
pincel.lineTo(xa, yc);
pincel.lineTo(xc, yc);
pincel.fill();
}
function desenhaEsquadro(xa, ya, xc, yc, cor){
criaTriangulo(xa, ya, xc, yc, cor);
criaTriangulo(xa*2, ya + 125, xc - 125, yc - 50, 'white')
}
desenhaEsquadro(50, 50, 400, 400, 'black')
</script>