Is this triangle acute, obtuse or right triangle?
var tr = new Triangle([0, 0], ANGLES, 10, {});
tr.labels = { "angles" : tr.niceAngles };
tr.rotate(ROTATE);
init({
range: tr.boundingRange(1)
})
tr.draw();
tr.drawLabels();
triangle.TR = tr;
var p1 = triangle.TR.points[0];
var p2 = triangle.TR.points[1];
var p3 = triangle.TR.points[2];
var a1 = PI + atan2(p1[1] - p2[1], p1[0] - p2[0]);
var a2 = PI + atan2(p1[1] - p3[1], p1[0] - p3[0]);
var dx1 = 0.5 * cos(a1);
var dy1 = 0.5 * sin(a1);
var dx2 = 0.5 * cos(a2);
var dy2 = 0.5 * sin(a2);
path([[p1[0] + dx1, p1[1] + dy1],
[p1[0] + dx1 + dx2, p1[1] + dy1 + dy2],
[p1[0] + dx2, p1[1] + dy2]],
{stroke: BLUE});
One of the angles is 90^\circ
, so this is a right triangle.
All the angles are less than 90^\circ
, so it is an acute triangle.
var p1 = triangle.TR.points[0];
var p2 = triangle.TR.points[1];
var p3 = triangle.TR.points[2];
var a1 = 180 + toDegrees(atan2(p1[1] - p2[1], p1[0] - p2[0]));
var a2 = 180 + toDegrees(atan2(p1[1] - p3[1], p1[0] - p3[0]));
arc(p1, 1, a1, a2, {stroke: BLUE});
One of the angles is greater than 90^\circ
, so this is an obtuse triangle.