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§
- Comparison
Options - 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 - 2π
Functions§
- deg_
to_ rad - Converts degrees to radians.
- nearly_
equal - Compares two floating point numbers
a
andb
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.