![]() |
Public API Reference |
Generic mathematic utility functions. More...
#include "csutil/algorithms.h"Go to the source code of this file.
Namespaces | |
| namespace | CS |
Main namespace for CrystalSpace. | |
| namespace | CS::Math |
Mathematical functions and definitions. | |
Functions | |
| template<class T > | |
| T | csClamp (const T &a, T max, T min) |
| Clamp a between max and min. | |
| template<class T , class Tfactor > | |
| T | csLerp (const T &a, const T &b, const Tfactor &f) |
| Performs a linear interpolation between a and b with the factor f. | |
| template<class T > | |
| const T & | csMax (const T &a, const T &b) |
| Returns bigger of a and b. | |
| template<class T > | |
| const T & | csMin (const T &a, const T &b) |
| Returns smaller of a and b. | |
| template<class T > | |
| T | csSmoothStep (const T &a, T max, T min) |
| Performs a smooth interpolation of a on range min to max. | |
| template<class T > | |
| void | csSort (T &a, T &b) |
| Sort a and b in order of size. | |
| template<class T , class U > | |
| void | csSort (T &a, T &b, U &x, U &y) |
| Sort a and b in order of size. | |
| template<class T > | |
| T | csSquare (const T &x) |
| Returns the square of the argument. | |
| template<typename T > | |
| T | CS::Math::NextModulo3 (T number) |
| Return the next number in the sequence 0,1,2 modulo 3. | |
Floating point utilities | |
| bool | CS::IsNaN (float f) |
| Checks if a floating point value is not-a-number. | |
| bool | CS::IsNaN_ext (double d) |
| Checks if a floating point value is not-a-number. | |
| bool | CS::IsNaN (double d) |
| Checks if a double-precision floating point value is not-a-number. | |
| bool | CS::IsFinite (float f) |
| Checks if a floating point value is finite. | |
| bool | CS::IsFinite_ext (double d) |
| Checks if a floating point value is not-a-number. | |
| bool | CS::IsFinite (double d) |
| Checks if a double-precision floating point value is finite. | |
| float | CS::Infinity () |
| Return Infinity. | |
| bool | csFinite (float f) |
| Checks if a floating point value is finite. | |
| bool | csFinite (double d) |
| Checks if a double-precision floating point value is finite. | |
| bool | csNaN (float f) |
| Checks if a floating point value is not-a-number. | |
| bool | csNaN (double d) |
| Checks if a double-precision floating point value is not-a-number. | |
| bool | csNormal (float f) |
| Checks if a floating point value is normal (not infinite or nan). | |
| bool | csNormal (double d) |
| Checks if a double-precision floating point value is normal. | |
Generic mathematic utility functions.
Definition in file math.h.