Point3
- class Point3()
Constructors
Methods
Constructors
- Point3.constructor(x, y, z)
- Arguments
x (
number()
) – X valuey (
number()
) – Y valuez (
number()
) – Z value
Creates a new point object.
- Return type
Point3
Properties
- Point3.x
- Type
number
- Point3.y
- Type
number
- Point3.z
- Type
number
Methods
static add
assign
copy
- Point3.copy()
Creates a copy of this point.
- Returns
Copy of this point object.
- Return type
Point3
equals
equalsWithTolerance
fromArray
- Point3.fromArray(arr)
- Arguments
arr (
[number]()
) – Array to assign from.
Sets this point from an array.
- Returns
This point object.
- Return type
this
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
negate
- Point3.negate()
Negates the point.
- Returns
This object.
- Return type
this
normalize
- Point3.normalize()
Normalizes the vector.
- Returns
This object.
- Return type
this
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
squaredLength
- Point3.squaredLength()
Returns the squared length of this vector.
- Returns
Vector squared length.
- Return type
number
static subtract
toArray
- Point3.toArray(arr)
- Arguments
arr (
[number]()
) – Array to assign.
Sets an array from this point.
- Return type
[number]
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
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
static zero
- Point3.zero()
Creates a new Point initialized to (0,0,0).
- Returns
New point with all elements set to 0.
- Return type
Point3