|
| template<class T > |
| T | Average (const T &a, const T &b) |
| | Calculates the average of arguments a and b. More... |
| |
|
template<class T > |
| T | bilerp (const T &s00, const T &s10, const T &s01, const T &s11, float u, float v) |
| | Perform bi-linear interpolation between four samples. |
| |
| template<class T > |
| T | calculateAbsSum (const T *values, int n) |
| | Calculates the sum of the absolute values in the argument array. More... |
| |
|
template<class T > |
| void | calculateMeanVariance (const T *values, int n, T *mean, T *variance) |
| | Calculates the mean and variance of a buffer of values. |
| |
| template<class T , class U > |
| void | calculatePrincipalAxes (const T *values, int n, U &axis1, U &axis2, float *variance1=0, float *variance2=0) |
| | Calculate the two principal axes in 2d data Length of the axes are the corresponding eigenvalues. More... |
| |
| template<class T > |
| T | Clamp (T x, T low, T high) |
| | Clamp a value between minimum and maximum values. More... |
| |
|
double | degToRad (const double degrees) |
| | Converts degrees into radians. |
| |
| template<class T > |
| T | Det (T a, T b, T c, T d) |
| | Calculates the determinant of a 2x2 matrix, which is given in the argument values. More... |
| |
|
template<class T > |
| T | Fraction (T x) |
| | Calculates the fraction of the floating point number. |
| |
| template<typename T > |
| bool | fuzzyCompare (const T &a, const T &b) |
| | Compare two values. More... |
| |
|
template<> |
| bool | fuzzyCompare (const int &a, const int &b) |
| |
|
float | InvSqrt (float v) |
| | Returns the inverse square root. |
| |
|
double | InvSqrt (double v) |
| | Returns the inverse square root. |
| |
| template<class T > |
| bool | IsClose (const T &a, const T &b, const T &limit) |
| | Checks if two (floating point) numbers are close to each other. More... |
| |
|
bool | isFinite (float v) |
| | Checks if the given value if finite. |
| |
| bool | isNAN (float v) |
| | Checks if the given number is a NaN. More... |
| |
|
template<class T > |
| T | lerp (const T &a, const T &b, float t) |
| | Perform linear interpolation between two samples. |
| |
|
float | Log2 (float v) |
| | Returns the logarithm in base 2. |
| |
|
double | Log2 (double v) |
| | Returns the logarithm in base 2. |
| |
|
template<class T > |
| T | Max (T x, T y) |
| | Returns the maximum of the values. |
| |
|
template<class T > |
| T | Max (T a, T b, T c) |
| | Returns the maximum of the values. |
| |
|
template<class T > |
| T | Max (T a, T b, T c, T d) |
| | Returns the maximum of the values. |
| |
|
template<class T > |
| T | Min (T x, T y) |
| | Returns the minimum of the values. |
| |
|
template<class T > |
| T | Min (T a, T b, T c) |
| | Returns the minimum of the values. |
| |
|
template<class T > |
| T | Min (T a, T b, T c, T d) |
| | Returns the minimum of the values. |
| |
|
double | radToDeg (const double radians) |
| | Converts radians to degrees. |
| |
|
int | Round (float x) |
| | Rounds the given number to nearest integer. |
| |
|
int | Round (double x) |
| | Rounds the given number to nearest integer. |
| |
|
template<class T > |
| Vector2T< int > | Round (const Vector2T< T > &that) |
| | Round the vector component-wise to the given vector. |
| |
|
template<typename T > |
| T | Roundf (T x) |
| | Same thing as std::round with floating point types Only exists because visual studio 2012 doesn't implement std::round. |
| |
|
template<class T > |
| int | Sign (T v) |
| | Return sign. |
| |
|
template<class T > |
| T | smoothstep (const T &a, const T &b, float t) |
| | Interpolate smoothly between two values based on third (Texturing and Modeling, Third Edition: A Procedural Approach, by Ken Perlin) |
| |
|
template<class T > |
| T | threePointInterpolation (float x1, const T &v1, float x2, const T &v2, float x3, const T &v3, float x) |
| | Given three points on a line, interpolate between them. |
| |
| template<class T > |
| T | Wrap (T x, T low, T high) |
| | Wraps the input value between minimum and maximum values For example you can normalize radians by Wrap(angle, 0, 2*PI) More... |
| |
Math functions and constants for Nimble.
This namespace contains mathematics constants (pi, ln2 etc.) and basic functions.