Module NiMath

Source
Expand description

NiMath module with math utility functions equivalent to NiMath.h and NiMath.cpp in C++.

Provides functions for angle conversions, trigonometry, and fast arctangent calculation.

Structs§

ComparisonOptions
Options for configuring the floating-point comparison behavior.

Constants§

NI_HALF_PI
π/2
NI_INFINITY
Infinity constant, equivalent to FLT_MAX.
NI_PI
π
NI_TWO_PI

Functions§

deg_to_rad
Converts degrees to radians.
nearly_equal
Compares two floating point numbers a and b to see if they are nearly equal.
ni_abs
Returns the absolute value of a float.
ni_asin
Computes the arcsine(tilt to angle) of a value with clamping to [-1, 1].
ni_fast_atan2
Approximates the arctangent of y/x using a fast polynomial expansion.
normalize_angle
Normalizes an angle in radians to the range [-π, π].
rad_to_deg
Converts radians to degrees.