Constructor Summary
Public Constructor | ||
public |
constructor(a: Point2D, b: Point2D, c: Point2D) Constructs a Triangle2D object. |
Member Summary
Public Members | ||
public |
a: * |
|
public get |
Getter for the (signed) area of the triangle. |
|
public |
b: * |
|
public |
c: * |
Method Summary
Public Methods | ||
public |
getBarycentricCoordinates(point: Point2D): Point2D Find the barycentric coordinates of a point relative to this triangle. |
|
public |
Find the cartesian coordinates of a point given its barycentric coordinates. |
Public Constructors
Public Members
public a: * source
public get area: number: * source
Getter for the (signed) area of the triangle.
1 | x1 y1 1 |
area = --- | x2 y2 1 | 2 | x3 y3 1 |
Test:
public b: * source
public c: * source
Public Methods
public getBarycentricCoordinates(point: Point2D): Point2D source
Find the barycentric coordinates of a point relative to this triangle. Source: http://stackoverflow.com/a/14382692/1418962 More info: https://en.wikipedia.org/wiki/Barycentric_coordinate_system#Conversion_between_barycentric_and_Cartesian_coordinates
Params:
Name | Type | Attribute | Description |
point | Point2D | The point to find the barycentric coordinates of. |