Class: Point

Point

The Point object represents a location in a two-dimensional coordinate system.

new Point (x, y)

Name Type Default Description
x number 0 optional

position of the point on the x axis

y number 0 optional

position of the point on the y axis

Members

x number

Default Value:
  • 0

y number

Default Value:
  • 0

Methods

distance (point)Number

Returns the distance between two points.

Name Type Description
point Point

Anther point object

Returns:
Type Description
Number

distanceAxis (point)Array.<Number, Number>

Returns the analytic distance([xDistance, yDistance]) between two points.
Math.pow(point.distanceAxis[0], 2) + Math.pow(point.distanceAxis[1], 2) == Math.pow(point.distance, 2)

Name Type Description
point Point

Anther point object

Returns:
Type Description
Array.<Number, Number>