Triangle
Triangle
Triangle
Private
centerTriangle
Readonly
classRequired to generate proper CSS classes and other class related IDs.
isDestroyed
Triangle
Private
radiusTriangle
Private
radius_Triangle
Readonly
uidThe UID of this drawable object.
Triangle
Static
Readonly
Private
EPSILONAn epsilon for comparison. This should be the same epsilon as in Vertex.
Static
Private
utilsRe-compute the circumcircle of this triangle (if the vertices have changed).
The circumcenter and radius are stored in this.center and this.radius. There is a third result: radius_squared (for internal computations).
void
calcCircumcircle
Triangle
Checks if the passed vertex (p) is inside this triangle.
Note: matrix determinants rock.
The vertex to check.
containsPoint
Triangle
Get the area of this triangle. The returned area is never negative.
If you are interested in the signed area, please consider using the
Triangle.utils.signedArea
helper function. This method just returns
the absolute value of the signed area.
The non-negative area of this triangle.
getArea
Triangle
Get the circumcircle of this triangle.
The circumcircle is that unique circle on which all three vertices of this triangle are located on.
Please note that for performance reasons any changes to vertices will not reflect in changes of the circumcircle (center or radius). Please call the calcCirumcircle() function after triangle vertex changes.
getCircumcircle
Triangle
Get the incenter of this triangle (which is the center of the circumcircle).
Note: due to performance reasonst the incenter is buffered inside the triangle because computing it is relatively expensive. If a, b or c have changed you should call the calcCircumcircle() function first, otherwise you might get wrong results.
Vertex The incenter of this triangle.
Check if the passed vertex is inside this triangle's circumcircle.
The vertex to check.
inCircumcircle
Triangle
Check if this triangle and the passed triangle share an adjacent edge.
For edge-checking Vertex.equals is used which uses an an epsilon for comparison.
The second triangle to check adjacency with.
isAdjacent
Triangle
Static
fromCreate a new triangle from the given array of vertices.
The array must have at least three vertices, otherwise an error will be raised. This function will not create copies of the vertices.
The required array with at least three vertices.
fromArray
Vertex
Classdesc
A triangle class for triangulations.
The class was written for a Delaunay trinagulation demo so it might contain some strange and unexpected functions.
Requires
Bounds
Requires
Circle
Requires
Line
Requires
Vertex
Requires
Polygon
Requires
SVGSerializale
Requires
UID
Requires
UIDGenerator
Requires
geomutils