Constructor
new Vector3D(x, y, z)
Name | Type | Description |
---|---|---|
x | number | The X component of the vector. |
y | number | The Y component of the vector. |
z | number | The Z component of the vector. |
- Source
Classes
Methods
crossProduct(vector3D) → {Vector3D}
Get the cross product with another Vector3D, ie the vector that is perpendicular to both a and b. If both vectors are parallel, the cross product is a zero vector.
Name | Type | Description |
---|---|---|
vector3D | Vector3D | The input vector. |
- Source
The result vector.
- Type:
- Vector3D
dotProduct(vector3D) → {number}
Get the dot product with another Vector3D.
Name | Type | Description |
---|---|---|
vector3D | Vector3D | The input vector. |
- Source
The dot product.
- Type:
- number
equals(rhs) → {boolean}
Check for Vector3D equality.
Name | Type | Description |
---|---|---|
rhs | Vector3D | The other vector to compare to. |
- Source
True if both vectors are equal.
- Type:
- boolean
getX() → {number}
Get the X component of the vector.
- Source
The X component of the vector.
- Type:
- number
getY() → {number}
Get the Y component of the vector.
- Source
The Y component of the vector.
- Type:
- number
getZ() → {number}
Get the Z component of the vector.
- Source
The Z component of the vector.
- Type:
- number
isCodirectional(vector3D) → {boolean}
Is this vector codirectional to an input one.
Name | Type | Description |
---|---|---|
vector3D | Vector3D | The vector to test. |
- Source
True if codirectional, false is opposite.
- Type:
- boolean
norm() → {number}
Get the norm of the vector.
- Source
The norm.
- Type:
- number
toString() → {string}
Get a string representation of the Vector3D.
- Source
The vector as a string.
- Type:
- string