©2010
Generated by JsDoc Toolkit 2.4.0 on Wed Sep 01 2010 15:32:51 GMT-0700 (PDT)
HTML template: Codeview

Class Point


Defined in: matrix.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Point(x, y)
Create a new point with given x and y coordinates.
Field Summary
Field Attributes Field Name and Description
 
x
The x coordinate of this point.
 
y
The y coordinate of this point.
Method Summary
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)
Class Detail
Point(x, y)
Create a new point with given x and y coordinates. If no arguments are given defaults to (0, 0).
Parameters:
{Number} x Optional
{Number} y Optional
Field Detail
x
The x coordinate of this point.
y
The y coordinate of this point.
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.
Parameters:
{Point} p1
The starting point.
{Point} p2
The ending point.
Returns:
The direction from p1 to p2 in radians.
<static> Point.distance(p1, p2)
Parameters:
{Point} p1
{Point} p2
Returns:
The Euclidean distance between two points.