![]() |
Assorted mathematical utility functions. More...
Include dependency graph for math.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Functions | |
| bool | GfIsClose (double a, double b, double epsilon) |
Returns true if a and b are with epsilon of each other. More... | |
| double | GfRadiansToDegrees (double radians) |
| Converts an angle in radians to degrees. More... | |
| double | GfDegreesToRadians (double degrees) |
| Converts an angle in degrees to radians. More... | |
| template<class T > | |
| double | GfSqr (const T &x) |
Returns the inner product of x with itself: specifically, x*x. More... | |
| template<typename T > | |
| T | GfSgn (T v) |
Return the signum of v (i.e. More... | |
| double | GfSqrt (double f) |
Return sqrt(f). More... | |
| float | GfSqrt (float f) |
Return sqrt(f). More... | |
| double | GfExp (double f) |
Return exp(f). More... | |
| float | GfExp (float f) |
Return exp(f). More... | |
| double | GfLog (double f) |
Return log(f). More... | |
| float | GfLog (float f) |
Return log(f). More... | |
| double | GfFloor (double f) |
Return floor(f). More... | |
| float | GfFloor (float f) |
Return floor(f). More... | |
| double | GfCeil (double f) |
Return ceil(f). More... | |
| float | GfCeil (float f) |
Return ceil(f). More... | |
| double | GfAbs (double f) |
Return abs(f). More... | |
| float | GfAbs (float f) |
Return abs(f). More... | |
| double | GfRound (double f) |
Return round(f). More... | |
| float | GfRound (float f) |
Return round(f). More... | |
| double | GfPow (double f, double p) |
Return pow(f, p). More... | |
| float | GfPow (float f, float p) |
Return pow(f, p). More... | |
| double | GfSin (double v) |
Return sin(v). More... | |
| float | GfSin (float v) |
Return sin(v). More... | |
| double | GfCos (double v) |
Return cos(v). More... | |
| float | GfCos (float v) |
Return cos(v). More... | |
| void | GfSinCos (double v, double *s, double *c) |
Return sin(v) in s and cos(v) in c. More... | |
| void | GfSinCos (float v, float *s, float *c) |
Return sin(v) in s and cos(v) in c. More... | |
| double | GfClamp (double value, double min, double max) |
Return the resulting of clamping value to lie between min and max. More... | |
| float | GfClamp (float value, float min, float max) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| GF_API double | GfMod (double a, double b) |
| The mod function with "correct" behaviour for negative numbers. More... | |
| GF_API float | GfMod (float a, float b) |
| template<class T > | |
| T | GfLerp (double alpha, const T &a, const T &b) |
| Linear interpolation function. More... | |
| template<class T > | |
| T | GfMin (T a1, T a2) |
Returns the smallest of the given values. More... | |
| template<class T > | |
| T | GfMin (T a1, T a2, T a3) |
| template<class T > | |
| T | GfMin (T a1, T a2, T a3, T a4) |
| template<class T > | |
| T | GfMin (T a1, T a2, T a3, T a4, T a5) |
| template<class T > | |
| T | GfMax (T a1, T a2) |
Returns the largest of the given values. More... | |
| template<class T > | |
| T | GfMax (T a1, T a2, T a3) |
| template<class T > | |
| T | GfMax (T a1, T a2, T a3, T a4) |
| template<class T > | |
| T | GfMax (T a1, T a2, T a3, T a4, T a5) |
| template<typename Left , typename Right , std::enable_if_t< GfIsArithmetic< Left >::value &&GfIsArithmetic< Right >::value, int > = 0> | |
| decltype(std::declval< Left > ()*std::declval< Right >()) | GfDot (Left left, Right right) |
| Returns the dot (inner) product of two vectors. More... | |
| template<typename Left , typename Right , std::enable_if_t< GfIsArithmetic< Left >::value &&GfIsArithmetic< Right >::value, int > = 0> | |
| decltype(std::declval< Left > ()*std::declval< Right >()) | GfCompMult (Left left, Right right) |
| Returns component-wise multiplication of vectors. More... | |
| template<typename Left , typename Right , std::enable_if_t< GfIsArithmetic< Left >::value &&GfIsArithmetic< Right >::value, int > = 0> | |
| decltype(std::declval< Left > ()/std::declval< Right >()) | GfCompDiv (Left left, Right right) |
| Returns component-wise quotient of vectors. More... | |
Assorted mathematical utility functions.
Definition in file math.h.
| GF_API float GfMod | ( | float | a, |
| float | b | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.