new Point(
x
?,y
?,z
?):Point
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
get y():
number
Returns y coordinate of 3D point.
number
set y(
y
):void
Sets y coordinate of 3D point.
number
Y coordinate.
void
get z():
number
Returns z coordinate of 3D point.
number
set z(
z
):void
Sets z coordinate of 3D point.
number
Z coordinate.
void
add(
other
):this
Adds other
vector coordinates to this
point coordinates.
Other 3D vector.
this
added(
other
):Point
Returns new Point
object with coordinates received by performing an add() operation to this
object.
Other vector.
added(
other
):Point
Returns new Point
object with coordinates received by performing an add operation to this
object.
Other point.
clone():
Point
Creates new Point
object with coordinates same as this
.
copy(
other
):this
Copies the coordinates of the other
point to this
.
Copied object.
this
distance(
other
):number
Returns distance between other
point and this
point.
Other point.
number
divide(
scalar
):this
Divide this
point coordinates by scalar
value.
number
Scalar value.
this
divided(
scalar
):Point
Returns new Point
object with coordinates received by performing a divide() operation to this
object.
number
Scalar value.
get(
index
):number
Returns coordinate value of 2D point:
index
equals 0
index
equals 1
index
equals 2
Throws 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
Coordinates comparison tolerance;
boolean
mirror(
point
):this
Mirrors this
3D point relative to other point
.
Other point.
this
mirror(
axis
):this
Mirrors this
3D point relative to axis
.
Axis.
this
mirror(
axis
):this
Mirrors this
3D point relative to axis
.
Axis.
this
mirrored(
point
):Point
Returns new Point
object with coordinates received by performing a mirror() operation to this
object.
Point.
mirrored(
axis
):Point
Returns new Point
object with coordinates received by performing a mirror() operation to this
object.
Axis.
mirrored(
axis
):Point
Returns new Point
object with coordinates received by performing a mirror() operation to this
object.
Axis.
multiplied(
matrix
):Point
Returns new Point
object with coordinates received by performing a multiply() operation to this
object.
3D matrix.
multiplied(
scalar
):Point
Returns new Point
object with coordinates received by performing a multiply() operation to this
object.
number
Scalar value.
multiply(
matrix
):this
Multiplies this
vector coordinates with 3D matrix.
3D matrix.
this
multiply(
scalar
):this
Multiplies this
vector coordinates with scalar
value.
number
Scalar value.
this
rotate(
axis
,angle
):this
Rotates this
3D point around axis
on angle
.
Rotation axis.
number
Rotation angle.
this
rotated(
axis
,angle
):Point
Returns new Point
object with coordinates received by performing a rotate() operation to this
object.
Rotation axis.
number
Rotation angle.
scale(
other
,scale
):this
Adds other
point coordinates to this
point coordinates, multiplied by scale
.
Other point.
number
Scale value.
this
scaled(
other
,scale
):Point
Returns new Point
object with coordinates received by performing a scale() operation to this
object.
Other point.
number
Scale value.
set(
index
,value
):this
Sets coordinate value of 2D point:
index
equals 0
index
equals 1
index
equals 2
Throws 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
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
vector coordinates from this
point coordinates.
Other vector.
this
subtracted(
other
):Point
Returns new Point
object with coordinates received by performing a subtract() operation to this
object.
Other vector.
subtracted(
other
):Vector
Returns new Point
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
transform(
transformation
):this
Transforms coordinates of this
point according to transformation
.
Transformation.
this
transformed(
transformation
):Point
Returns new Point
object with coordinates received by performing a transform() operation to this
object.
Transformation.
translate(
vector
):this
Translates this
point coordinates.
Translation vector.
this
translated(
vector
):Point
Returns new Point
object with coordinates received by performing a translate() operation to this
object.
Translation vector.
static
fromXYZ(xyz
):Point
Creates new Point
object from object implementing BaseXYZ interface.
Object implementing BaseXYZ interface.
static
origin():Point
Returns Point
with (0, 0, 0)
coordinates.