Class: Point2D

Point2D(x, y)

Models a point in 2D space

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
Source:

Members

x

Gets the x coordinate of this point
Source:

x

Gets the x coordinate of this point
Source:

y

Gets the x coordinate of this point
Source:

y

Gets the y coordinate of this point
Source:

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
Source:

distanceTo(point) → {number}

Calculates the distance between two points
Parameters:
Name Type Description
point Object The point to measure distance to
Source:
Returns:
The distance between this point and the one passed
Type
number