Constructor Summary
Public Constructor | ||
public |
constructor(x: number, y: number) Constructs a Point2D object. |
Method Summary
Public Methods | ||
public |
distanceTo(point: Point2D): number Finds the distance between this point and another point. |
|
public |
Checks if this point and another point are equal. |
|
public |
Creates and returns a Line2D object using this point as the start point and another point as the end point. |
|
public |
relativePositionToTriangle2D(oldTriangle: Triangle2D, newTriangle: Triangle2D): Point2D Finds the coordinates this point should have relative to a triangle. |
|
public |
translateVec(vec: Vector2D): Point2D Translates the point using a vector. |
|
public |
Finds the vector distance from this point to another point. |
Public Constructors
Public Methods
public distanceTo(point: Point2D): number source
Finds the distance between this point and another point.
Params:
Name | Type | Attribute | Description |
point | Point2D | Point to find the distance to. |
public equals(point: Point2D): boolean source
Checks if this point and another point are equal. Returns true if the x- and y-coordinates are equal.
Params:
Name | Type | Attribute | Description |
point | Point2D | Point to compare with. |
Test:
public lineTo(point: Point2D): Line2D source
Creates and returns a Line2D object using this point as the start point and another point as the end point.
Params:
Name | Type | Attribute | Description |
point | Point2D | Point to be used as the end point. |
Test:
public relativePositionToTriangle2D(oldTriangle: Triangle2D, newTriangle: Triangle2D): Point2D source
Finds the coordinates this point should have relative to a triangle.
Params:
Name | Type | Attribute | Description |
oldTriangle | Triangle2D | Triangle2D object containing the triangle's old position. |
|
newTriangle | Triangle2D | Triangle2D object containing the triangle's new position. |