Represents a 3-dimensional vector with x, y, and z components. Provides common vector operations and geometric transformations.
Value parameters
- x
-
The x-component (in meters).
- y
-
The y-component (in meters).
- z
-
The z-component (in meters).
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Multiplies the vector by a scalar.
Multiplies the vector by a scalar.
Value parameters
- scalar
-
The scalar value.
Attributes
- Returns
-
The scaled vector.
Adds two vectors.
Adds two vectors.
Value parameters
- other
-
The other vector.
Attributes
- Returns
-
The sum vector.
Subtracts another vector from this vector.
Subtracts another vector from this vector.
Value parameters
- other
-
The other vector.
Attributes
- Returns
-
The difference vector.
Divides the vector by a scalar.
Divides the vector by a scalar.
Value parameters
- scalar
-
The scalar value.
Attributes
- Returns
-
The scaled vector.
Computes the cross product of two vectors.
Computes the cross product of two vectors.
Value parameters
- other
-
The other vector.
Attributes
- Returns
-
The cross product vector.
Calculates the angle between this vector and another.
Calculates the angle between this vector and another.
Type parameters
- T
-
The type of AngleUnit.
Value parameters
- factory
-
Factory function to create an AngleUnit from a Double.
- second
-
The other vector.
Attributes
- Returns
-
The angle as an AngleUnit.
Calculates the distance to another vector.
Calculates the distance to another vector.
Type parameters
- T
-
The type of DistanceUnit.
Value parameters
- factory
-
Factory function to create a DistanceUnit from a Double.
- second
-
The other vector.
Attributes
- Returns
-
The distance as a DistanceUnit.
Computes the dot product of two vectors.
Computes the dot product of two vectors.
Value parameters
- other
-
The other vector.
Attributes
- Returns
-
The dot product.
Computes the magnitude (length) of the vector.
Computes the magnitude (length) of the vector.
Attributes
- Returns
-
The magnitude.
Returns the normalized (unit length) vector.
Returns the normalized (unit length) vector.
Attributes
- Returns
-
The normalized vector.
Rotates the vector around the X axis by the given angle.
Rotates the vector around the X axis by the given angle.
Value parameters
- angle
-
The angle to rotate by.
Attributes
- Returns
-
The rotated vector.
Rotates the vector around the Y axis by the given angle.
Rotates the vector around the Y axis by the given angle.
Value parameters
- angle
-
The angle to rotate by.
Attributes
- Returns
-
The rotated vector.
Rotates the vector around the Z axis by the given angle.
Rotates the vector around the Z axis by the given angle.
Value parameters
- angle
-
The angle to rotate by.
Attributes
- Returns
-
The rotated vector.
Returns a string representation of the vector.
Returns a string representation of the vector.
Attributes
- Returns
-
String in the format Vector3D(x, y, z) [m]
- Definition Classes
-
Any
Checks if two vectors are approximately equal within a given epsilon.
Checks if two vectors are approximately equal within a given epsilon.
Value parameters
- epsilon
-
The tolerance.
- other
-
The other vector.
Attributes
- Returns
-
True if all components are within epsilon, false otherwise.
Inherited methods
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product