Protractor
Source: protractor.js:12
Protractor shape: 3 points from which to calculate an angle.
Constructor
new Protractor(points: Array.<Point2D>): ProtractorParameters
points(Array.<Point2D>) — The list of Point2D that make the protractor.
Instance Methods
getPoint(index: number): Point2D | undefined
Get a point of the list.
Parameters
index(number) — The index of the point to get (beware, no size check).
Returns
Point2D| undefined— The Point2D at the given index.
getLength(): number
Get the length of the path (should be 3).
Returns
number— The length of the path.
getCentroid(): Point2D
Get the centroid of the protractor.
Returns
Point2D— THe centroid point.
contains(point: Point2D, tolerance?: number): boolean
Check if a point is on one of the protractor lines, within a tolerance.
Parameters
point(Point2D) — The point to check.tolerance(number, optional, default: 0) — Optional maximum distance to the lines, defaults to 0.
Returns
boolean— True if the point is on the protractor.
quantify(
_viewController: ViewController,
_flags: Array.<string>,
): Record.<string, NumberValue>
Quantify a path according to view information.
Parameters
_viewController(ViewController) — The associated view controller._flags(Array.<string>) — A list of stat values to calculate.
Returns
Record.<string,NumberValue>— A quantification object.