55 Vector3D(
const float&
X,
const float&
Y,
const float&
Z);
Provides a collection of mathematical utility functions and constants.
Implements a generic Kalman Filter for 1D data.
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.
Vector3D Normal() const
Computes the squared magnitude of the vector (X^2 + Y^2 + Z^2).
float Max() const
Returns the maximum component value among X, Y, Z.
float Min() const
Returns the minimum component value among X, Y, Z.
Vector3D operator-(const Vector3D &vector) const
Subtraction operator. Subtracts two vectors component-wise.
static Vector3D RadiansToDegrees(const Vector3D &radians)
Converts a Vector3D of radians to degrees (component-wise).
bool operator==(const Vector3D &vector) const
Equality operator. Checks if two Vector3Ds are equal (component-wise).
Vector3D CrossProduct(const Vector3D &vector) const
Computes the cross product of this vector with another Vector3D.
Vector3D Divide(const Vector3D &vector) const
Divides this vector by another Vector3D component-wise.
Vector3D operator+(const Vector3D &vector) const
Addition operator. Adds two vectors component-wise.
float AverageHighestTwoComponents() const
Computes the average of the highest two components of this vector.
Vector3D operator+=(const Vector3D &vector)
In-place addition operator. Adds another vector to this one component-wise.
Vector3D operator*(const Vector3D &vector) const
Multiplication operator. Multiplies two vectors component-wise.
Vector3D operator/(const Vector3D &vector) const
Division operator. Divides two vectors component-wise.
static Vector3D LERP(const Vector3D &start, const Vector3D &finish, const float &ratio)
Performs linear interpolation between two Vector3Ds.
String ToString() const
Converts the vector to a string representation.
Vector3D operator=(const Vector3D &vector)
Assignment operator. Copies another Vector3D into this one.
float Z
The Z-component of the 3D vector.
static Vector3D DegreesToRadians(const Vector3D °rees)
Converts a Vector3D of degrees to radians (component-wise).
Vector3D UnitSphere() const
Normalizes this vector such that its magnitude is 1 (if non-zero).
Vector3D Permutate(const Vector3D &permutation) const
Permutates the components of this vector using another Vector3D as an index/offset.
Vector3D Multiply(const Vector3D &vector) const
Multiplies this vector by another Vector3D component-wise.
Vector3D Constrain(const float &minimum, const float &maximum) const
Constrains each component of this vector between two scalar bounds.
float X
The X-component of the 3D vector.
float Y
The Y-component of the 3D vector.
float DotProduct(const Vector3D &vector) const
Computes the dot product of this vector with another Vector3D.
float CalculateEuclideanDistance(const Vector3D &vector) const
Calculates the Euclidean distance between this vector and another Vector3D.
float Magnitude() const
Computes the magnitude (length) of this vector using the formula sqrt(X^2 + Y^2 + Z^2).
bool IsEqual(const Vector3D &vector) const
Checks if this vector is equal to another Vector3D component-wise.
Vector3D Add(const float &value) const
Adds a scalar value to each component of the vector.
Vector3D Absolute() const
Returns a vector with the absolute value of each component.
Vector3D()
Constructs a default Vector3D with X = 0, Y = 0, and Z = 0.
Vector3D Subtract(const float &value) const
Subtracts a scalar value from each component of the vector.
bool operator!=(const Vector3D &vector) const
Inequality operator. Checks if two Vector3Ds differ (component-wise).