Constructor
new Point2D(x, y)
Creates a point
Parameters:
Name | Type | Description |
---|---|---|
x |
number | The x axis coordinate of the point |
y |
number | The y axis coordinate of the point |
Members
x
Gets the x coordinate of this point
x
Gets the x coordinate of this point
y
Gets the x coordinate of this point
y
Gets the y coordinate of this point
Methods
copy(point)
Copies the values of another point to this one
Parameters:
Name | Type | Description |
---|---|---|
point |
Object | The point to copy to this one |
distanceTo(point) → {number}
Calculates the distance between two points
Parameters:
Name | Type | Description |
---|---|---|
point |
Object | The point to measure distance to |
Returns:
The distance between this point and the one passed
- Type
- number