Constructor
new Point(xopt, yopt)
Creates a new one based on the specified coordinates
Point
Object.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
x |
Number
|
<optional> |
0 | x (optional) horizontal coordinates. |
y |
Number
|
<optional> |
0 | y (optional) vertical coordinates. |
Member
(static) EMPTY :Point
(static) TEMP :Point
x :Number
The horizontal coordinates of this point.
y :Number
The vertical coordinates of this point.
Methods
create()
Establish
distance(x, y) → {Number}
Calculates the distance between the current point and the target point (x, y).
Parameters:
Name | Type | Description |
---|---|---|
x |
Number
|
Horizontal coordinate. |
y |
Number
|
Vertical coordinate. |
Returns:
- Type:
-
Number
Returns the distance between the current point and the destination point.
normalize()
Normalized vector.
recover()
recovery
reset()
Reset
setTo(x, y) → {Point}
take
Point
The member is set to the specified value.
Parameters:
Name | Type | Description |
---|---|---|
x |
Number
|
Horizontal coordinate. |
y |
Number
|
Vertical coordinate. |
toString()
Returns the string containing the value of the X and Y coordinates.