Constructor
new Point2D(x, y)
Parameters:
Name | Type | Description |
---|---|---|
x | number | The X coordinate for the point. |
y | number | The Y coordinate for the point. |
- Source
Classes
Methods
equals(rhs) → {boolean}
Check for Point2D equality.
Parameters:
Name | Type | Description |
---|---|---|
rhs | Point2D | The other point to compare to. |
- Source
Returns:
True if both points are equal.
- Type:
- boolean
getCentroid() → {Point2D}
Get the centroid of the point, ie itself.
- Source
Returns:
The centroid point.
- Type:
- Point2D
getDistance(point2D) → {number}
Get the distance to another Point2D.
Parameters:
Name | Type | Description |
---|---|---|
point2D | Point2D | The input point. |
- Source
Returns:
Ths distance to the input point.
- Type:
- number
getValues() → {Array.<number>}
Get the values of this point.
- Source
Returns:
The array of values.
- Type:
- Array.<number>
getX() → {number}
Get the X position of the point.
- Source
Returns:
The X position of the point.
- Type:
- number
getY() → {number}
Get the Y position of the point.
- Source
Returns:
The Y position of the point.
- Type:
- number
toString() → {string}
Get a string representation of the Point2D.
- Source
Returns:
The point as a string.
- Type:
- string