Two triangles make a square

HTML canvas, js