100 (this->
Y * vector.
Z) - (this->
Z * vector.
Y),
101 (this->
Z * vector.
X) - (this->
X * vector.
Z),
102 (this->
X * vector.
Y) - (this->
Y * vector.
X)
111 if (length == 0)
return Vector3D(0, 1, 0);
185 return (this->
X == vector.
X) && (this->
Y == vector.
Y) && (this->
Z == vector.
Z);
194 return "[" + x +
", " +
y +
", " +
z +
"]";
277 return (
v1.X ==
v2.X) && (
v1.Y ==
v2.Y) && (
v1.Z ==
v2.Z);
286 return !(this->
IsEqual(vector));
Defines a 3D vector and various related operations.
Implements a generic Kalman Filter for 1D data.
static float Sqrt(float value)
Computes the square root of a value.
static T Min(T value1, T value2)
Returns the minimum of two values.
static bool IsClose(float v1, float v2, float epsilon)
Checks if two values are close within a specified epsilon.
static String DoubleToCleanString(float value)
Converts a floating-point value to a String, removing trailing decimals if not needed.
static T Max(T value1, T value2)
Returns the maximum of two values.
static const float MPID180
The value of , useful for converting degrees to radians.
static const float EPSILON
A small constant used for floating-point comparisons.
static T Constrain(T value, T minimum, T maximum)
Constrains a value between minimum and maximum.
static const float M180DPI
The value of , useful for converting radians to degrees.
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).