new Point(
x?,y?,z?):Point
Creates a point from coordinates.
If coordinates are omitted, the point is created at (0, 0, 0).
number
X coordinate of 3D point.
number
Y coordinate of 3D point.
number
Z coordinate of 3D point.
Point
get x():
number
X coordinate of the point.
number
set x(
x):void
Sets the X coordinate of the point.
number
X coordinate.
void
get y():
number
Y coordinate of the point.
number
set y(
y):void
Sets the Y coordinate of the point.
number
Y coordinate.
void
get z():
number
Z coordinate of the point.
number
set z(
z):void
Sets the Z coordinate of the point.
number
Z coordinate.
void
add(
other):this
Adds the coordinates of other to this point.
Other 3D vector.
this
added(
other):Point
Returns a new point resulting from adding other to this point.
Other vector.
Point
added(
other):Point
Returns a new point whose coordinates are the sums of the coordinates of this point and other.
Point
Other point.
Point
clone():
Point
Creates a new point with the same coordinates as this point.
Point
copy(
other):this
Copies the coordinates of other to this point.
Point
Point to copy.
this
distance(
other):number
Returns the distance between this point and other.
Point
Other point.
number
divide(
scalar):this
Divides the coordinates of this point by scalar.
number
Scalar value.
this
divided(
scalar):Point
Returns a new point resulting from dividing this point by scalar.
number
Scalar value.
Point
staticfromXYZ(xyz):Point
Creates a point from an object implementing the BaseXYZ interface.
Object implementing BaseXYZ interface.
Point
get(
index):number
Returns the coordinate value of the point:
index equals 0index equals 1index equals 2Throws a RangeError if index is not in the range [0, 2].
number
Coordinate index.
number
isEqual(
other,tolerance?):boolean
Returns whether this point is equal to other within the provided coordinate tolerance.
Point
Other 3D point.
number = Point.coincidenceTolerance
Coordinate comparison tolerance (1e-7 by default).
boolean
mirror(
point):this
Mirrors this point about point.
Point
Other point.
this
mirror(
axis):this
Mirrors this point about axis.
Axis.
this
mirror(
axis):this
Mirrors this point about axis.
Axis.
this
mirrored(
point):Point
Returns a new point resulting from mirroring this point about point.
Point
Point.
Point
mirrored(
axis):Point
Returns a new point resulting from mirroring this point about axis.
Axis.
Point
mirrored(
axis):Point
Returns a new point resulting from mirroring this point about axis.
Axis.
Point
multiplied(
matrix):Point
Returns a new point resulting from multiplying this point by matrix.
3D matrix.
Point
multiplied(
scalar):Point
Returns a new point resulting from multiplying this point by scalar.
number
Scalar value.
Point
multiply(
matrix):this
Multiplies the coordinates of this point by a 3D matrix.
3D matrix.
this
multiply(
scalar):this
Multiplies the coordinates of this point by a scalar value.
number
Scalar value.
this
staticorigin():Point
Returns a point with coordinates (0, 0, 0).
Point
rotate(
axis,angle):this
Rotates this point around axis by angle.
Rotation axis.
number
Rotation angle.
this
rotated(
axis,angle):Point
Returns a new point resulting from rotating this point.
Rotation axis.
number
Rotation angle.
Point
scale(
other,scale):this
Scales this point with respect to other.
The resulting coordinates are computed as other + scale * (this - other).
Point
Other point.
number
Scale value.
this
scaled(
other,scale):Point
Returns a new point resulting from scaling this point.
Point
Other point.
number
Scale value.
Point
set(
index,value):this
Sets the coordinate value of the point:
index equals 0index equals 1index equals 2Throws a RangeError if index is not in the range [0, 2].
number
Coordinate index.
number
Coordinate value.
this
setCoord(
x?,y?,z?):this
Sets the specified coordinates of the point.
number
X coordinate of 3D point.
number
Y coordinate of 3D point.
number
Z coordinate of 3D point.
this
setX(
x):this
Sets the X coordinate of the point.
number
X coordinate.
this
setY(
y):this
Sets the Y coordinate of the point.
number
Y coordinate.
this
setZ(
z):this
Sets the Z coordinate of the point.
number
Z coordinate.
this
squareDistance(
other):number
Returns the squared distance between this point and other.
Point
Other point.
number
subtract(
other):this
Subtracts the coordinates of other from this point.
Other vector.
this
subtracted(
other):Point
Returns a new point resulting from subtracting other from this point.
Other vector.
Point
subtracted(
other):Vector
Returns the vector from other to this point.
Point
Other point.
toJSON():
BaseXYZ
Returns the JSON representation of this point.
toString(
precision?):string
Returns a string representation of this point with the provided precision.
number = 3
Precision.
string
transform(
transformation):this
Transforms this point according to transformation.
Transformation.
this
transformed(
transformation):Point
Returns a new point resulting from transforming this point.
Transformation.
Point
translate(
vector):this
Translates this point by vector.
Translation vector.
this
translated(
vector):Point
Returns a new point resulting from translating this point.
Translation vector.
Point