../../Developer.FoundationDotJS.org/wwwroot/Library/Foundation.Geometry.jsFoundationObject
All Implemented Interfaces:
Foundation.Point
implementsFoundation.Class
Two dimensional point class with x and y.
| Constructor Summary |
Creates a point from an x and y.
|
Creates a point from another point.
|
| Field Summary | |
| x
The x value of the point.
|
| y
The y value of the point.
|
| Method Summary | |
|
Positively offsets the point by another point.
|
|
Positively offsets the point by x and y values.
|
|
The angle from another point.
|
|
Ceils both the x and y values of the point.
|
|
Creates a copy of the point.
|
|
|
|
The distance to another point.
|
|
Compares a point with another point.
|
|
Compares a point with x and y values.
|
|
Floors both the x and y values of the point.
|
|
The magnitude of the point as a vector.
|
static |
Parses a string representation of a point into a new
Foundation.Point. |
|
Rotates the point by an angle.
|
|
Rounds both the x and y values of the point.
|
|
Scales the point.
|
|
Sets the point equal to another point.
|
|
Sets the point equal to x and y values.
|
|
Sets the point to one of nine absolute directions based on the x,y values. The x and y values will each become -1, 0, or 1 depending on whether each was less than, equal to, or greater than 0.
|
|
Negatively offsets the point by another point.
|
|
Negatively offsets the point by x and y values.
|
|
A string representation of the point.
|
|
Transforms the point by an transformation matrix.
|
Methods inherited from Foundation.Class |
getTypePath, isInstanceOf |
| Constructor Detail |
Foundation.Point(/*Number*/ x,
/*Number*/ y)
Creates a point from an x and y.
Parameters:x -X value.
y -Y value.
Foundation.Point(/*Point*/ point)
Creates a point from another point.
Parameters:point -Point to copy.
| Field Detail |
Number x
The x value of the point.
Number y
The y value of the point.
| Method Detail |
[this] add(/*Point*/ point)
Positively offsets the point by another point.
Parameters:point -Other point add by.
[this] add(/*Number*/ x,
/*Number*/ y)
Positively offsets the point by x and y values.
Parameters:x -X value to add by.
y -Y value to add by.
Number angle(/*Point*/ point)
The angle from another point.
Parameters:point -(Optional) The other point (or 0,0 if not passed).
[this] ceil()
Ceils both the x and y values of the point.
Returns:
Point clone()
Creates a copy of the point.
Returns:
dispose()
dispose in class Class
Number distance(/*Point*/ point)
The distance to another point.
Parameters:point -The other point.
Boolean equals(/*Point*/ point)
Compares a point with another point.
Parameters:point -Other point to compare to.
Boolean equals(/*Number*/ x,
/*Number*/ y)
Compares a point with x and y values.
Parameters:x -X value to compare to.
y -Y value to compare to.
[this] floor()
Floors both the x and y values of the point.
Returns:
Number magnitude()
static Point parse(/*String*/ pointString)
Parses a string representation of a point into a new Foundation.Point.
pointString -The string representation of the point.
[this] rotate(/*Number*/ radians)
Rotates the point by an angle.
Parameters:radians -The angle (in radians) to rotate the point by.
[this] round()
Rounds both the x and y values of the point.
Returns:
[this] scale(/*Number*/ scale)
Scales the point.
Parameters:scale -The amount to scale by.
[this] set(/*Point*/ point)
Sets the point equal to another point.
Parameters:point -Other point to set by.
[this] set(/*Number*/ x,
/*Number*/ y)
Sets the point equal to x and y values.
Parameters:x -X value to set by.
y -Y value to set by.
[this] sign()
Sets the point to one of nine absolute directions based on the x,y values. The x and y values will each become -1, 0, or 1 depending on whether each was less than, equal to, or greater than 0.
Returns:
[this] subtract(/*Point*/ point)
Negatively offsets the point by another point.
Parameters:point -Other point subtract by.
[this] subtract(/*Number*/ x,
/*Number*/ y)
Negatively offsets the point by x and y values.
Parameters:x -X value to subtract by.
y -Y value to subtract by.
String toString()
A string representation of the point.
Overrides:toString in class Class
[this] transform(/*TMatrix*/ tMatrix)
Transforms the point by an transformation matrix.
Parameters:tMatrix -The transformation matrix.