Class Point
Defined in: matrix.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Point(x, y)
Create a new point with given x and y coordinates.
|
| Field Attributes | Field Name and Description |
|---|---|
|
The x coordinate of this point.
|
|
|
The y coordinate of this point.
|
| Method Attributes | Method Name and Description |
|---|---|
|
add(other)
Adds a point to this one and returns the new point.
|
|
| <static> |
Point.direction(p1, p2)
If you have two dudes, one standing at point p1, and the other
standing at point p2, then this method will return the direction
that the dude standing at p1 will need to face to look at p2.
|
| <static> |
Point.distance(p1, p2)
|
Method Detail
{Point}
add(other)
Adds a point to this one and returns the new point.
- Parameters:
- {Point} other
- The point to add this point to.
- Returns:
- A new point, the sum of both.
<static>
Point.direction(p1, p2)
If you have two dudes, one standing at point p1, and the other
standing at point p2, then this method will return the direction
that the dude standing at p1 will need to face to look at p2.
- Returns:
- The direction from p1 to p2 in radians.
<static>
Point.distance(p1, p2)
- Returns:
- The Euclidean distance between two points.