Triangle class provides static functions to create and operate on trianges. A triange is a polygon represented as a Group of 3 Pts.
You can use the static functions as-is, or apply the Group.op
or Pt.op
to enable functional programming.
See Op guide for details.
Get a triangle's altitude, which is a line from a triangle's point to its opposite side, and perpendicular to its opposite side.
a Group or an Iterable
a Pt on the triangle group
a Group that represents the altitude line
Get circumcenter, which is the intersection point of its 3 perpendicular bisectors lines ( each of which divides a side in half and is perpendicular to the side).
a Group or an Iterable
the circumcenter as a Pt
Get circumcenter, which is the intersection point of its 3 perpendicular bisectors lines ( each of which divides a side in half and is perpendicular to the side).
a Group or an Iterable
Optional parameter if the circumcenter is already known. Otherwise, leave it empty and the circumcenter will be calculated
Create an equilateral triangle based on a center point and a size.
the center point
size is the magnitude of lines from center to the triangle's vertices, like a "radius".
Create a triangle that fits within a circle.
a Group or an Iterable
Create a triangle from a rectangle. The triangle will be isosceles, with the bottom of the rectangle as its base.
a Group or an Iterable
Get incenter, which is the center point of its inner circle, and also the intersection point of its 3 angle bisector lines (each of which cuts one of the 3 angles in half).
a Group or an Iterable
the incenter as a Pt
Get an interior circle, which is the largest circle completed enclosed by this triangle.
a Group or an Iterable
Optional parameter if the incenter is already known. Otherwise, leave it empty and the incenter will be calculated
Get the medial, which is an inner triangle formed by connecting the midpoints of this triangle's sides.
a Group or an Iterable
a Group representing a medial triangle
Given a point of the triangle, the opposite side is the side which the point doesn't touch.
a Group or an Iterable
a Pt on the triangle group
a Group that represents a line of the opposite side
Get orthocenter, which is the intersection point of a triangle's 3 altitudes (the 3 lines that are perpendicular to its 3 opposite sides).
a Group or an Iterable
the orthocenter as a Pt