new Vector3D(x, y, z)
- Source:
Immutable 3D vector.
Parameters:
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. |
Methods
crossProduct(vector3D) → {dwv.math.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.
Parameters:
Name | Type | Description |
---|---|---|
vector3D |
dwv.math.Vector3D | The input vector. |
Returns:
The result vector.
- Type
- dwv.math.Vector3D
dotProduct(vector3D) → {number}
Get the dot product with another Vector3D.
Parameters:
Name | Type | Description |
---|---|---|
vector3D |
dwv.math.Vector3D | The input vector. |
Returns:
The dot product.
- Type
- number
equals(rhs) → {boolean}
- Source:
Check for Vector3D equality.
Parameters:
Name | Type | Description |
---|---|---|
rhs |
object | The other vector to compare to. |
Returns:
True if both vectors are equal.
- Type
- boolean
getX() → {number}
- Source:
Get the X component of the vector.
Returns:
The X component of the vector.
- Type
- number
getY() → {number}
- Source:
Get the Y component of the vector.
Returns:
The Y component of the vector.
- Type
- number
getZ() → {number}
- Source:
Get the Z component of the vector.
Returns:
The Z component of the vector.
- Type
- number
norm() → {number}
- Source:
Get the norm of the vector.
Returns:
The norm.
- Type
- number
toString() → {string}
- Source:
Get a string representation of the Vector3D.
Returns:
The vector as a string.
- Type
- string