CrystalSpace

Public API Reference

csgeom/math.h File 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 >
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.
template<typename T >
CS::Math::NextModulo3 (T number)
 Return the next number in the sequence 0,1,2 modulo 3.



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).
Floating point utilities



float CS::Infinity ()
 Return Infinity.
bool CS::IsFinite (double d)
 Checks if a double-precision floating point value is finite.
bool CS::IsFinite (float f)
 Checks if a floating point value is finite.
bool CS::IsFinite_ext (double d)
 Return Infinity.
bool CS::IsNaN (double d)
 Checks if a double-precision floating point value is not-a-number.
bool CS::IsNaN (float f)
 Checks if a floating point value is not-a-number.
bool CS::IsNaN_ext (double d)
 Return Infinity.

Detailed Description

Generic mathematic utility functions.

Definition in file math.h.


Generated for Crystal Space 2.0 by doxygen 1.6.1