new Triangle(v1)
Represents a triangle composed on 3 vectors. Vectors can be of any size, though some of it methods only work with 2-dimensional vectors.
Parameters:
Name | Type | Description |
---|---|---|
v1 |
Properties:
Name | Type | Description |
---|---|---|
centroid |
SQR.V2 | the centroid, undef until |
circumRadius |
Number | the radius of the
circum-circle, undef until |
circumCenter |
SQR.V2 | the center of the cirsum-circle,
undef until |
- Source:
Methods
calculateCentroid()
Calculates the centroid for this triangle. Only works with 2d coordinates for now.
The resulting centroid is stored in the centroid
property.
- Source:
calculateCircumCircle()
- Source:
vertexInCircumcircle(v) → {boolean}
Test whether the point v is inside the triangles circumcircle. If circum-circle was not calculated, calculateCircumCircle will be called first
Parameters:
Name | Type | Description |
---|---|---|
v |
SQR.V2 | vertex to be checked |
- Source:
Returns:
true is vertex is in circumcircle
- Type
- boolean