Provides a collection of mathematical utility functions and constants.
Defines a 3D vector and various related operations.
Implements a generic Kalman Filter for 1D data.
Represents a 2D vector (X, Y) and provides methods for vector arithmetic.
Vector2D Multiply(const Vector2D &vector) const
Multiplies this vector by another Vector2D component-wise.
Vector2D Rotate(const float &angle, const Vector2D &offset) const
Rotates this vector by a specified angle (in degrees or radians) around a given offset.
Vector2D Divide(const Vector2D &vector) const
Divides this vector by another Vector2D component-wise.
static Vector2D RadiansToDegrees(const Vector2D &radians)
Converts a vector of radians to degrees (component-wise).
Vector2D operator+(const Vector2D &vector) const
Addition operator. Adds two vectors component-wise.
Vector2D operator/(const Vector2D &vector) const
Division operator. Divides two vectors component-wise.
Vector2D Maximum(const Vector2D &v) const
Computes the maximum components between this vector and another Vector2D.
bool operator!=(const Vector2D &vector) const
Inequality operator. Checks if two Vector2Ds differ (component-wise).
bool CheckBounds(const Vector2D &minimum, const Vector2D &maximum) const
Checks if this vector lies within the bounds of two other Vector2D objects.
bool IsEqual(const Vector2D &vector) const
Checks if this vector is equal to another Vector2D component-wise.
float DotProduct(const Vector2D &vector) const
Computes the dot product of this vector with another Vector2D.
static Vector2D LERP(const Vector2D &start, const Vector2D &finish, const float &ratio)
Performs linear interpolation between two Vector2Ds.
Vector2D()
Constructs a default Vector2D with X = 0 and Y = 0.
Vector2D Minimum(const Vector2D &v) const
Computes the minimum components between this vector and another Vector2D.
Vector2D Normal() const
Computes the squared magnitude of the vector (X^2 + Y^2).
Vector2D Subtract(const Vector2D &vector) const
Subtracts another Vector2D from this vector component-wise.
float CalculateEuclideanDistance(const Vector2D &vector) const
Calculates the Euclidean distance between this vector and another Vector2D.
Vector2D UnitCircle() const
Normalizes this vector such that its magnitude is 1 (if non-zero).
Vector2D operator*(const Vector2D &vector) const
Multiplication operator. Multiplies two vectors component-wise.
static Vector2D DegreesToRadians(const Vector2D °rees)
Converts a vector of degrees to radians (component-wise).
String ToString() const
Converts the vector to a string representation.
Vector2D operator=(const Vector2D &vector)
Assignment operator. Copies another Vector2D into this one.
float CrossProduct(const Vector2D &vector) const
Calculates the 2D cross product of this vector with another.
float X
The X-component of the 2D vector.
float Y
The Y-component of the 2D vector.
Vector2D Absolute() const
Returns a vector with the absolute value of each component.
Vector2D Add(const Vector2D &vector) const
Adds this vector to another Vector2D component-wise.
Vector2D Constrain(const float &minimum, const float &maximum) const
Constrains each component of this vector between the specified minimum and maximum.
bool operator==(const Vector2D &vector) const
Equality operator. Checks if two Vector2Ds are equal (component-wise).
float Magnitude() const
Computes the magnitude (length) of this vector using the formula sqrt(X^2 + Y^2).
Vector2D operator-(const Vector2D &vector) const
Subtraction operator. Subtracts two vectors component-wise.
static bool LineSegmentsIntersect(const Vector2D &p1, const Vector2D &p2, const Vector2D &q1, const Vector2D &q2)
Checks if two line segments defined by (p1, p2) and (q1, q2) intersect in 2D space.
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.