Point3
-
class
Point3()
Constructors
Methods
-
Point3.add() - add(pt:
IPoint3): thisAdds another point to this point.
Parameters
pt:IPoint3Returns: this
This point object.
-
Point3.assign() - assign(point:
IPoint3): thisSets this point equal to another point.
Parameters
point:
IPoint3The point to assign.Returns: this
This point object.
-
Point3.copy() - copy():
Point3Creates a copy of this point.
Returns:
Point3Copy of this point object.
-
Point3.equals() - equals(other:
IPoint3): booleanStrictly compares this point with another.
Parameters
other:
IPoint3Point to compare with.Returns: boolean
True if the values of this point equal those of the other.
-
Point3.equalsWithTolerance() - equalsWithTolerance(other:
IPoint3, tolerance: number): booleanCompares this point with another using a tolerance.
Parameters
Returns: boolean
True if the values of this point equal those of the other.
-
Point3.fromArray() - fromArray(arr: number[]): this
Sets this point from an array.
Parameters
arr: number[]
Array to assign from.Returns: this
This point object.
-
Point3.isAxis() - isAxis(): boolean
Returns a boolean value indicating if this vector lies on a major axis.
Returns: boolean
-
Point3.length() - length(): number
Returns the length of this vector.
Returns: number
Vector length.
-
Point3.negate() - negate(): this
Negates the point.
Returns: this
This object.
-
Point3.normalize() - normalize(): this
Normalizes the vector.
Returns: this
This object.
-
Point3.scale() - scale(k: number): this
Scale the point by constant value.
Parameters
k: number
Constant value to scale by.Returns: this
Point object.
-
Point3.set() - set(x: number, y: number, z: number): this
Sets the values of this point.
Parameters
x: number
X value to set.y: number
Y value to set.z: number
Z value to set.Returns: this
This point object.
-
Point3.squaredLength() - squaredLength(): number
Returns the squared length of this vector.
Returns: number
Vector squared length.
-
Point3.subtract() - subtract(pt:
IPoint3): thisSubtracts another point from this point.
Parameters
pt:IPoint3Returns: this
This point object.
-
Point3.toArray() - toArray(arr: number[]?): number[]
Sets an array from this point.
Parameters
arr: number[] = …
Array to assign.Returns: number[]
-
Point3.toJson() - toJson():
IPoint3Creates an object ready for JSON serialization.
Returns:
IPoint3The prepared object.
-
static Point3.createFromArray() static
createFromArray(arr: number[]):Point3Creates a point from an array of numbers
Parameters
arr: number[]Returns:
Point3new point set from array elements
-
static Point3.cross() static
Calculate cross product.
Parameters
Returns:
Point3Cross product of p1 and p2.
-
static Point3.distance() static
Calculate distance between two points
Parameters
Returns: number
Distance between p1 and p2
-
static Point3.dot() static
Calculate dot product.
Parameters
Returns: number
Dot product of p1 and p2.
-
static Point3.fromJson() static
fromJson(objData: unknown):Point3Creates a new [[Point3]] from an object given by [[toJson]].
Parameters
objData: unknown
An object given by [[toJson]].Returns:
Point3The prepared object.
-
static Point3.magnitude() static
magnitude(p:IPoint3): numberReturns the length of a vector.
Parameters
p:IPoint3Returns: number
Vector length.
-
static Point3.normalize() static
Normalize a vector.
Parameters
v:
IPoint3First point.Returns:
Point3A vector that is colinear to v with a length of 1.
-
static Point3.scale() static
Scale a point by a constant factor
Parameters
Returns:
Point3Copy of p scaled by a constant factor
-
static Point3.squaredLength() static
squaredLength(p:IPoint3): numberReturns the squared length of a vector.
Parameters
p:IPoint3Returns: number
Vector squared length.