Cubios::Math
Global Defines
LN_2
Summary
Coupling coefficient of binary and natural logarithm
Synopsis
PI
Summary
PI value
Synopsis
PI_2
Summary
PI / 2 value Synopsis
TINY
Summary
"Small" value used for thresholds
Synopsis
n_max
Summary
Returns the largest value
Synopsis
n_min
Summary
Returns the smallest value
Synopsis
n_abs
Summary
Returns the absolute value
Synopsis
n_sgn
Summary
Returns the sign of a value
Synopsis
n_deg2rad
Summary
Converts degrees to radians
Synopsis
n_rad2deg
Summary
Converts radians to degrees
Synopsis
n_sin
Summary
Caluclates sine value as float
Synopsis
n_cos
Summary
Caluclates cosine value as float
Synopsis
n_tan
Summary
Caluclates tangent value as float
Synopsis
n_atan
Summary
Caluclates arctangent value as float
Synopsis
Static functions
log2
Summary
Calculates base 2 logarithm
Arguments
- f - input value
Synopsis
iclamp
Summary
Performs integer clamping
Arguments
- val - input value
- minVal - minimum clamp value
- maxVal - maximum clamp value
Synopsis
acos
Summary
Calculates arccosine with value clamping
Arguments
- x - input value
Synopsis
asin
Summary
Calculates arcsine with value clamping
Arguments
- x - input value
Synopsis
sqrt
Summary
Calculates safe square root
Arguments
- x - input value
Synopsis
fequal
Summary
Does fuzzy floating point equality check
Arguments
- f0 - first value to check
- f1 - second value to check
- tol - comparison tolerance
Synopsis
fless
Summary
Does fuzzy floating point less-than check
Arguments
- f0 - first value to check
- f1 - second value to check
- tol - comparison tolerance
Synopsis
fgreater
Summary
Does fuzzy floating point greter-than check
Arguments
- f0 - first value to check
- f1 - second value to check
- tol - comparison tolerance
Synopsis
ftol
Summary
Fast float to long int conversion with truncation
Arguments
- val - input value
Synopsis
smooth
Summary
Smoothes a new value towards an old value using a change value
Arguments
- newVal - new value
- curVal - current value
- maxChange - maximum change step
Synopsis
clamp
Summary
Clamp a value against lower and upper boundary
Arguments
- val - input value
- lower - lower boundary
- upper - upper boundary
Synopsis
lerp
Summary
Caluclate linear interpolation between two values as result = x + l * (y-x)
Arguments
- x - input x value
- y - input y value
- l - interpolation factor
Synopsis
saturate
Summary
Saturates a value by clamping it between 0.0f and 1.0f
Arguments
- val - input value
Synopsis
rand
Summary
Generates a pseudo-random integer number
Synopsis
rand2
Summary
Generates a pseudo-random number between 0.0f and 1.0f
Synopsis
randGetSeed
Summary
Returns current randomizer seed
Synopsis
randSetSeed
Summary
Sets randomizer seed
Arguments
- s - new randomizer seed value
Synopsis
randInt
Summary
Returns random integer in range of [0,n]
Arguments
- n - range upper boundary
Synopsis
randReal
Summary
Returns random float in [0.0,1.0]
Synopsis