Class: Triangle

SQR. Triangle

Constructor

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 Vector SQR.V2 or SQR.V3
Properties:
Name Type Description
centroid SQR.V2 the centroid, undef until `calculateCentroid` is called.
circumRadius Number the radius of the circum-circle, undef until `calculateCircumCircle` is called.
circumCenter SQR.V2 the center of the cirsum-circle, undef until `calculateCircumCircle` is called.
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()

Calculates circumcircle, only works with 2d coordinates.

Based on this and this.
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