Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

BasicMath.h File Reference

Basic math functions and constants. More...

#include <assert.h>

Go to the source code of this file.

Namespaces

namespace  ZFXMath

Classes

struct  ZFXMath::ARGB

Functions

template<class T> T RadToDeg (T &rad)
 conversion from radian to degree
template<class T> T DegToRad (T &degree)
 conversion from degree to radian
template<class T> T Sin (const T &rad)
 sine
template<class T> T Cos (const T &rad)
 cosine
template<class T> void SinCos (const T &rad, T &retSin, T &retCos)
 sine and cosine
template<class T> T Tan (const T &rad)
 tangent
template<class T> T ASin (const T &value)
 arcsine
template<class T> T ACos (const T &value)
 arcsine
template<class T> T ATan (const T &value)
 arctangent
template<class T> T Sqrt (const T &value)
 squareroot
template<class T> T Pow2 (const T &base)
 square
template<class T> T Pow (const T &base, const T &exp)
 exponentiation
template<class T> T Mod (const T &value1, const T &value2)
 calculates value1 value2
template<class T> T Abs (const T &value)
 calculates |value|
template<class T> T LogE (T &num)
 logarithm of 'num' to the base e
template<class T> T Log10 (T &num)
 logarithm of 'num' to the base 10
template<class T> T Log (T &base, T &num)
 logarithm of 'num' to the base 'base'
template<class T> int Round (T &value)
 round to nearest integer
template<class T> T Round (T &value, int digits)
 round to an number of digits <muss noch übersetzt werden , please help :)>
template<class T> int RoundUp (T &value)
 round up
template<class T> T RoundDown (T &value)
 round down
template<class T> const bool IsEven (const T &value)
 test if number is even or not
template<class T> const T & Min (const T &value1, const T &value2)
 less number of <t1> and <t2>
template<class T> const T & Max (const T &value1, const T &value2)
 bigger number of <t1> and <t2>
template<class T> const T & Clamp (const T &value, const T &min, const T &max)
 clamp <t> to <min> and <max>
template<class T> bool NearTo (const T &value, const T &nearto)
 value is near to another
template<class T> T Sign (const T &value)
 if t<0, than -1, if t>0, than 1, else 0
template<class T1, class T2> T1 Interpolate (const T1 &v1, const T1 &v2, const T2 &lerp)
 interpolates linearly between two values
template<class T> T Fac (T value)
 computes factorial
template<class T> T Frac (T value)
 computes fraction
double Noise (unsigned int x)
 1D-Perlin Noise function
double Noise (unsigned int x, unsigned int y)
 2D-Perlin Noise function
double SmoothNoise (unsigned int x)
 Smooth 1D-Noise (Gaussian Distribution).
double SmoothNoise (unsigned int x, unsigned int y)
 Smooth 2D-Noise (Gaussian Distribution).
double InterpolatedNoise (double x, double y)
 2D-Noise based on floatingpoint parameters
double SmoothInterpolatedNoise (double x, double y)
 Smooth 2D-Noise based on floatingpoint parameters.

Variables

const double EPSILON = 0.00001
 accuracy
const double E = 2.71828182845904523536
 mathematical constant e
const double LOG2_E = 1.44269504088896340736
 logarithm of e to the base 2
const double LOG10_E = 0.434294481903251827651
 logarithm of e to the base 10
const double LOGE_2 = 0.693147180559945309417
 logarithm of 2 to the base e
const double LOGE_10 = 2.30258509299404568402
 logarithm of 10 to the base e
const double PI = 3.14159265358979323846
 mathematical constant pi
const double SQRT_2 = 1.41421356237309504880
 quareroot of 2


Detailed Description


Generated on Thu Nov 25 04:02:58 2004 for ZFX-Math Library by doxygen 1.3.8