public class Vector3d<NUMBER extends AbstractNumber = Double>:
Represents a three-dimensional vector with x, y, and z components.
Example:
direction = Vector3d<Double>(1.0, 2.0, 3.0) print(direction.magnitude())
| Modifier and Type | Member | Description |
|---|---|---|
| public property | xx as NUMBER |
X component. |
| public propert | yy y as NUMBER |
Y component. |
| public property | zz as NUMBER |
Z component. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | Vector3dVector3d(x as NUMBER, y as NUMBER, z as NUMBER): |
Creates a vector from its three components. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | cross | Computes the cross product with another vector. |
| public | dot | Computes the dot product with another vector. |
| public | magnitudemagnitude() as Double: |
Computes the Euclidean vector length. |
| public | normalize | Returns a unit vector with the same direction. |
| public override | toStringtoString() as String: |
Returns a readable representation of the vector. |
| Modifier and Type | Member | Description |
|---|---|---|
| public static | operator*(v1 as Vector3d<NUMBER>, scalar as NUMBER) as Vector3d<NUMBER>: | Multiplies a vector by a scalar. |
| public static | operator+(v1 as Vector3d<NUMBER>, v2 as Vector3d<NUMBER>) as Vector3d<NUMBER>: | Adds two vectors component by component. |
| public static | operator-(v1 as Vector3d<NUMBER>, v2 as Vector3d<NUMBER>) as Vector3d<NUMBER>: | Subtracts two vectors component by component. |