[ $._("Right"), $._("Acute"), $._("Obtuse") ] randRange(0, 2) (function() { var a, b; if (TYPE_NUM === 0) { a = 90; b = randRange(20, 70); } else if (TYPE_NUM === 1) { a = randRange(20, 89); b = randRange(max(20, 89 - a), min(89, 160 - a)); } else { a = randRange(91, 140); b = randRange(20, 160 - a); } return [a, b, 180 - a - b]; })() randRange(0, 360)
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;

TYPES[TYPE_NUM]

  • TYPES[0]
  • TYPES[1]
  • TYPES[2]
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.