# csgeom/math.h File Reference

Generic mathematic utility functions. More...

`#include "csutil/algorithms.h"`

Go to the source code of this file.

## Functions

template<class T>
csClamp (const T &a, T max, T min)
Clamp a between max and min.
template<class T, class Tfactor>
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>
csSmoothStep (const T &a, T max, T min)
Performs a smooth interpolation of a on range min to max.
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>
void csSort (T &a, T &b)
Sort a and b in order of size.
template<class T>
csSquare (const T &x)
Returns the square of the argument.
bool csFinite (double d)
Checks if a double-precision floating point value is finite.
bool csFinite (float f)
Checks if a floating point value is finite.
bool csNaN (double d)
Checks if a double-precision floating point value is not-a-number.
bool csNaN (float f)
Checks if a floating point value is not-a-number.
bool csNormal (double d)
Checks if a double-precision floating point value is normal.
bool csNormal (float f)
Checks if a floating point value is normal (not infinite or nan).

## Detailed Description

Generic mathematic utility functions.

Definition in file math.h.

Generated for Crystal Space 1.2.1 by doxygen 1.5.3