Implements 3D point interface and operations.
new XYZ(
x?,y?,z?):XYZ
number
X coordinate of 3D point.
number
Y coordinate of 3D point.
number
Z coordinate of 3D point.
get x():
number
Returns x coordinate of 3D point.
number
set x(
x):void
Sets x coordinate of 3D point.
number
X coordinate.
void
X coordinate of 3D point.
get y():
number
Returns y coordinate of 3D point.
number
set y(
y):void
Sets y coordinate of 3D point.
number
Y coordinate.
void
Y coordinate of 3D point.
get z():
number
Returns z coordinate of 3D point.
number
set z(
z):void
Sets z coordinate of 3D point.
number
Z coordinate.
void
Z coordinate of 3D point.
add(
other):this
Adds other point coordinates to this point coordinates.
Other point.
this
added(
other):XYZ
Returns new XYZ object with coordinates received by performing a add() operation to this object.
Other point.
angle(
other):number
Returns angle between this and other points.
Other point.
number
clone():
XYZ
Creates new XYZ point with coordinates same as this.
copy(
other):this
Copies the coordinates of the other point to this.
Copied object.
this
cross(
other):this
Sets coordinates of this point as cross product of this and other points.
Other point.
this
crossCross(
coord1,coord2):this
Computes this = this.cross(coord1.cross(coord2)).
First point.
Second point.
this
crossCrossed(
coord1,coord2):XYZ
Returns new XYZ object with coordinates received by performing a crossCross() operation to this object.
First point.
Second point.
crossed(
other):XYZ
Returns new XYZ object with coordinates received by performing a cross() operation to this object.
Other point.
divide(
scalar):this
Divide this point coordinates by scalar value.
number
Scalar value.
this
divided(
scalar):XYZ
Returns new XYZ object with coordinates received by performing a divide() operation to this object.
number
Scalar value.
dot(
other):number
Returns dot product of this and other points.
Other point.
number
get(
index):number
Returns coordinate value of 3D point:
index equals 0index equals 1index equals 2Throws exception if index is not in range [0, 2].
number
Coordinate index.
number
isEqual(
other,tolerance):boolean
Returns true if other point coordinates are equal to this point coordinated within provided tolerance (1e-7 by default). Returns false otherwise.
Other 3D point.
number = XYZ.coincidenceTolerance
Coordinates comparison tolerance;
boolean
isNormal(
other,tolerance):boolean
Returns true if other point is perpendicular to this within provided tolerance (1e-7 by default).
Other point.
number = XYZ.angularTolerance
boolean
isOpposite(
other,tolerance):boolean
Returns true if other point is opposite to this within provided tolerance (1e-7 by default).
Other point.
number = XYZ.angularTolerance
boolean
isParallel(
other,tolerance):boolean
Returns true if other point is parallel to this within provided tolerance (1e-7 by default).
Other point.
number = XYZ.angularTolerance
boolean
modulus():
number
Returns modulus of this point.
number
multiplied(
other):XYZ
Returns new XYZ object with coordinates received by performing a multiply() operation to this object.
Other point.
multiplied(
matrix):XYZ
Returns new XYZ object with coordinates received by performing a multiply() operation to this object.
3D matrix.
multiplied(
scalar):XYZ
Returns new XYZ object with coordinates received by performing a multiply() operation to this object.
number
Scalar value.
multiply(
other):this
Multiplies this point coordinates with other point coordinates.
Other point.
this
multiply(
matrix):this
Multiplies this point coordinates with 3D matrix.
3D matrix.
this
multiply(
scalar):this
Multiplies this point coordinates with scalar value.
number
Scalar value.
this
normalize():
this
Normalizes coordinates of this point.
this
normalized():
XYZ
Returns new XYZ object with normalized coordinates of this point.
reverse():
this
Reverses coordinates of this point.
this
reversed():
XYZ
Returns new XYZ object with coordinates received by performing a reverse() operation to this object.
set(
index,value):this
Sets coordinate value of 3D point:
index equals 0index equals 1index equals 2Throws exception if index is not in range [0, 2].
number
Coordinate index.
number
Coordinate value.
this
setCoord(
x?,y?,z?):this
Sets x, y and z coordinates of this object.
number
X coordinate of 3D point.
number
Y coordinate of 3D point.
number
Z coordinate of 3D point.
this
setX(
x):this
Sets x coordinate of 3D point.
number
X coordinate.
this
setY(
y):this
Sets y coordinate of 3D point.
number
Y coordinate.
this
setZ(
z):this
Sets z coordinate of 3D point.
number
Z coordinate.
this
subtract(
other):this
Subtracts other point coordinates from this point coordinates.
Other point.
this
subtracted(
other):XYZ
Returns new XYZ object with coordinates received by performing a subtract() operation to this object.
Other point.
toJSON():
BaseXYZ
Returns JSON representation of this point.
toString(
precision):string
Returns string representation of this point with provided precision (3 by default).
number = 3
Precision.
string
staticfromXYZ(xyz):XYZ
Creates new XYZ object from object implementing BaseXYZ interface.
Object implementing BaseXYZ interface.