Functions for working with equilateral triangles, defined by length
Functions for working with right-angled triangles, defined by two of three edges
Return the three interior angles of the triangle, in radians.
Returns the three interior angles of the triangle, in degrees
Applies fn
to each of a triangle's corner points, returning the result.
Calculates the area of a triangle
Returns the Barycentric coordinate of a point within a triangle
Convert Barycentric coordinate to Cartesian
Returns the bounding box that encloses the triangle.
Returns simple centroid of triangle
Returns the corners (vertices) of the triangle as an array of points
Returns the edges (ie sides) of the triangle as an array of lines
Returns a triangle anchored at origin
with a given length
and angleRadian
.
The origin will be point b
of the triangle, and the angle will be the angle for b.
Returns a triangle from a set of coordinates in a flat array form: [xA, yA, xB, yB, xC, yC]
Returns a triangle from an array of three points
Returns an equilateral triangle centered at the origin.
Throws an exception if the triangle is invalid
Returns the largest circle enclosed by triangle t
.
Returns true if point is within or on the boundary of triangle
Returns true if triangle is actue: all interior angles less than 90 degrees
Returns true if triangle is empty
Returns true if the two parameters have equal values
Returns true if it is an equilateral triangle
Returns true if it is an isosceles triangle
Returns true if triangle is oblique: No interior angle is 90 degrees
Returns true if triangle is obtuse: at least one interior angle is greater than 90 degrees
Returns true if triangle is a placeholder
Returns true if at least one interior angle is 90 degrees
Returns true if the parameter appears to be a valid triangle
Returns the lengths of the triangle sides
Returns the largest circle touching the corners of triangle t
.
Calculates perimeter of a triangle
Returns a triangle that is rotated by angleRad
. By default it rotates
around its center but an arbitrary origin
point can be provided.
Rotates the vertices of the triangle around one point (by default, b
), returning
as a new object.
Returns the coordinates of triangle in a flat array form: [xA, yA, xB, yB, xC, yC]
A triangle consisting of three empty points (Points.Empty)
A triangle consisting of three placeholder points (Points.Placeholder)
Triangle processing.
Helpers for creating:
[ aX, aY, bX, bY, cX, cY ]
There are sub-modules for dealing with particular triangles:
Calculations
Conversions
[aX, aY, bX, bY, cX, cY]
Comparisons