Class CAAT.Math.Point
Defined in: Point.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
point x coordinate.
|
|
point y coordinate.
|
|
point z coordinate.
|
Method Attributes | Method Name and Description |
---|---|
<private> |
__init(xpos, ypos, zpos)
|
clone()
Create a new CAAT.Point equal to this one.
|
|
getAngle()
Return the angle from -Pi to Pi of this point.
|
|
getDistance(point)
Get the distance between two points.
|
|
getDistanceSquared(point)
Get the squared distance between two points.
|
|
Get this point's lenght.
|
|
Get this point's squared length.
|
|
limit(max)
Set this point coordinates proportinally to a maximum value.
|
|
multiply(factor)
Multiply this point by a scalar.
|
|
Normalize this point, that is, both set coordinates proportionally to values raning 0.
|
|
rotate(angle)
Rotate this point by an angle.
|
|
set(x, y, z)
Sets this point coordinates.
|
|
setAngle(angle)
|
|
setLength(length)
|
|
subtract(aPoint)
Substract a point from this one.
|
|
toString()
Get a string representation.
|
|
translate(x, y, z)
Translate this point to another position.
|
|
translatePoint(aPoint)
Translate this point to another point.
|
Field Detail
x
point x coordinate.
y
point y coordinate.
z
point z coordinate.
Method Detail
<private>
__init(xpos, ypos, zpos)
- Parameters:
- xpos
- ypos
- zpos
{CAAT.Point}
clone()
Create a new CAAT.Point equal to this one.
- Returns:
- {CAAT.Point}
{number}
getAngle()
Return the angle from -Pi to Pi of this point.
- Returns:
- {number}
{number}
getDistance(point)
Get the distance between two points.
- Parameters:
- point
- {CAAT.Point}
- Returns:
- {number}
{number}
getDistanceSquared(point)
Get the squared distance between two points.
- Parameters:
- point
- {CAAT.Point}
- Returns:
- {number}
{number}
getLength()
Get this point's lenght.
- Returns:
- {number}
{number}
getLengthSquared()
Get this point's squared length.
- Returns:
- {number}
limit(max)
Set this point coordinates proportinally to a maximum value.
- Parameters:
- max
- {number}
- Returns:
- this
multiply(factor)
Multiply this point by a scalar.
- Parameters:
- factor
- {number}
- Returns:
- this
normalize()
Normalize this point, that is, both set coordinates proportionally to values raning 0..1
- Returns:
- this
rotate(angle)
Rotate this point by an angle. The rotation is held by (0,0) coordinate as center.
- Parameters:
- angle
- {number}
- Returns:
- this
set(x, y, z)
Sets this point coordinates.
- Parameters:
- x
- {number}
- y
- {number}
- z
- {number=}
- Returns:
- this
setAngle(angle)
- Parameters:
- angle
- {number}
- Returns:
- this
setLength(length)
- Parameters:
- length
- {number}
- Returns:
- this
subtract(aPoint)
Substract a point from this one.
- Parameters:
- aPoint
- {CAAT.Point}
- Returns:
- this
{string}
toString()
Get a string representation.
- Returns:
- {string}
translate(x, y, z)
Translate this point to another position. The final point will be (point.x+x, point.y+y)
- Parameters:
- x
- {number}
- y
- {number}
- z
- Returns:
- this
translatePoint(aPoint)
Translate this point to another point.
- Parameters:
- aPoint
- {CAAT.Point}
- Returns:
- this