19 return std::isinf(
value);
23 return std::isfinite(
value);
27 return std::fabs(
v1 -
v2) < epsilon;
53 float mid = (
beg -
fin) / 2.0f;
61 float baseSine =
sinf(16.0f * ratio) *
powf((2.0f * ratio - 2.0f), 2.0f) / 4.0f / 4.0f;
64 return Map(ratio, 0.0f, bounce,
beg,
fin);
72 return f < 0 ? -
f :
f;
80 return t *
t * (3 - 2 *
t);
84 return t *
t *
t * (
t * (
t * 6 - 15) + 10);
88 return a +
t * (b - a);
92 float p = (d - c) - (a - b);
93 float q = (a - b) - p;
97 return p *
t *
t *
t +
q *
t *
t + r *
t +
s;
102 float s1 =
x2 - scaleX;
103 float s2 = scaleX -
x1;
104 float t1 =
y2 - scaleY;
105 float t2 = scaleY -
y1;
115 t -= (
int)(
t * 0.5f) * 2;
116 return t < 1 ?
t : 2 -
t;
Provides a collection of mathematical utility functions and constants.
Implements a generic Kalman Filter for 1D data.
static int Sign(float value)
Determines the sign of a floating-point value.
static float BilinearInterpolation(float scaleX, float scaleY, float x1, float y1, float x2, float y2, float v11, float v12, float v21, float v22)
Performs a bilinear interpolation on a 2D grid.
static float Sqrt(float value)
Computes the square root of a value.
static const float FLTMIN
Minimum float value (shortcut to a very small or near-zero number).
static const float MPI
Mathematical constant (3.14159265358979323846...).
static float HermiteInterpolation(float t)
Hermite interpolation function for smooth transitions.
static float Lerp(float a, float b, float t)
Linear interpolation between 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 const float FLTMAX
Maximum float value (shortcut to a large number).
static float CosineTransition(float beg, float fin, float ratio)
A convenience alias for CosineInterpolation.
static bool IsFinite(float value)
Checks if a floating-point value is finite.
static T Map(T value, T inLow, T inMax, T outMin, T outMax)
Maps a value from one range to another.
static float QuinticInterpolation(float t)
Quintic interpolation function for smooth transitions.
static float Fract(float value)
Returns the fractional part of a floating-point value.
static int RoundUpWindow(int value, int multiple)
Rounds value up to the nearest multiple of multiple.
static float Pow(float value, float exponent)
Raises a value to a given exponent.
static float CubicLerp(float a, float b, float c, float d, float t)
Cubic interpolation across four points (a, b, c, d).
static float FSqrt(float f)
Computes the square root of a value (internal wrapper for std::sqrt).
static float FAbs(float f)
Returns the absolute value of a floating-point number.
static const float MPID180
The value of , useful for converting degrees to radians.
static bool IsInfinite(float value)
Checks if a floating-point value is infinite.
static const float EPSILON
A small constant used for floating-point comparisons.
static const float M180DPI
The value of , useful for converting radians to degrees.
static float CosineInterpolation(float beg, float fin, float ratio)
Applies a cosine-based interpolation between two values.
static float BounceInterpolation(float beg, float fin, float ratio)
A 'bounce'-like interpolation between two values.
static float FFloor(float f)
Floors a floating-point value (rounds down).
static bool IsNaN(float value)
Checks if a floating-point value is NaN (Not a Number).
static float PingPong(float t)
Repeats a value between 0 and 1, then mirrors back and forth (like a ping-pong).