Point3
-
class
Point3
()
Constructors
Methods
Constructors
-
Point3.
constructor
(x, y, z) Arguments: - x (
number()
) – X value - y (
number()
) – Y value - z (
number()
) – Z value
Creates a new point object.
Return type: Point3 - x (
Methods
static add
assign
copy
-
Point3.
copy
() Creates a copy of this point.
Returns: Copy of this point object. Return type: Point3
equals
equalsWithTolerance
-
Point3.
equalsWithTolerance
(other, tolerance) Arguments: - other (
IPoint3()
) – Point to compare with. - tolerance (
number()
) – Tolerance to be used in the comparison.
Compares this point with another using a tolerance.
Returns: True if the values of this point equal those of the other. Return type: boolean - other (
fromArray
-
Point3.
fromArray
(arr) Arguments: - arr (
[number]()
) – Array to assign from.
Sets this point from an array.
Returns: This point object. Return type: this - arr (
isAxis
-
Point3.
isAxis
() Returns a boolean value indicating if this vector lies on a major axis.
Return type: boolean
length
-
Point3.
length
() Returns the length of this vector.
Returns: Vector length. Return type: number
static normalize
static scale
set
-
Point3.
set
(x, y, z) Arguments: - x (
number()
) – X value to set. - y (
number()
) – Y value to set. - z (
number()
) – Z value to set.
Sets the values of this point.
Returns: This point object. Return type: this - x (
static squaredLength
static subtract
toArray
-
Point3.
toArray
(arr) Arguments: - arr (
[number]()
) – Array to assign.
Sets an array from this point.
Return type: [number] - arr (
toJson
-
Point3.
toJson
() Creates an object ready for JSON serialization.
Returns: The prepared object. Return type: IPoint3
static createFromArray
-
Point3.
createFromArray
(arr) Arguments: - arr (
[number]()
) – None
Creates a point from an array of numbers
Returns: new point set from array elements Return type: Point3 - arr (
static cross
static distance
static dot
static fromJson
-
Point3.
fromJson
(objData) Arguments: - objData (
unknown()
) – An object given by [[toJson]].
Creates a new [[Point3]] from an object given by [[toJson]].
Returns: The prepared object. Return type: Point3 - objData (