Vector3d
classin packageklyn.math.geometry
public class Vector3d<NUMBER extends AbstractNumber = Double>:
Vector3d
Represents a 3-dimensional vector with x, y, and z components.
Properties
Modifier and Type Member Description
public property x
x as NUMBER:
No summary.
public propert y
y y as NUMBER:
No summary.
public property z
z as NUMBER:
No summary.
Constructors
Modifier and Type Member Description
public Vector3d
Vector3d(x as Double, y as Double, z as Double):
Constructor for Vector3d.
Methods
Modifier and Type Member Description
public cross
cross(other as Vector3d) as Vector3d:
Computes the cross product of this vector with another vector.
public dot
dot(other as Vector3d) as Double:
Computes the dot product of this vector with another vector.
public magnitude
magnitude() as Double:
Calculates the magnitude of the vector.
public normalize
normalize() as Vector3d:
Normalizes the vector.
public toString
toString() as String:
Returns a string representation of the vector.
Operators
Modifier and Type Member Description
public static operator*(v1 as Vector, scalar as Double) as Vector3d: Multiplies this vector by a scalar.
public static operator+(v1 as Vector, v2 as Vector) as Vector3d: Adds another vector to this vector.
public static operator-(v1 as Vector, v2 as Vector) as Vector3d: Subtracts another vector from this vector.