# Math functions [H3DUtil classes]

Different functions used for mathematics. More...

Collaboration diagram for Math functions:

## Functions

bool H3DUtil::isPowerOfTwo (unsigned int i)
Determines if the given integer is a power of two or not.
unsigned int H3DUtil::nextPowerOfTwo (unsigned int i)
If i is a power of two, i is returned.
template<class F >
H3DUtil::H3DAbs (F f)
Returns the absolute value of f.
template<class F >
H3DUtil::H3DSqrt (F f)
Returns the square root of f.
template<class F >
H3DUtil::H3DExp (F f)
Returns the exponential function of f.
template<class F >
H3DUtil::H3DLog (F f)
Returns the natural logarithm of f.
template<class F >
H3DUtil::H3DLog10 (F f)
Returns the base 10 logarithm of f.
template<class F , class T >
H3DUtil::H3DPow (F f, T t)
Returns f raised to the power of t.
double H3DUtil::H3DPow (int f, int t)
Returns f raised to the power of t.
template<class A >
H3DUtil::H3DMax (const A &a, const A &b)
Returns the maximum value of a and b.
template<class A >
H3DUtil::H3DMin (const A &a, const A &b)
Returns the minimum value of a and b.
template<class F >
H3DUtil::H3DCos (F d)
Returns the cosine of d.
template<class F >
H3DUtil::H3DCosh (F d)
Returns the hyperbolic cosine of d.
template<class F >
H3DUtil::H3DAcos (F d)
Returns the arccosine of d.
template<class F >
H3DUtil::H3DSin (F d)
Returns the sine of d.
template<class F >
H3DUtil::H3DSinh (F d)
Returns the hyperbolic sine of d.
template<class F >
H3DUtil::H3DAsin (F d)
Returns the arcsine of d.
template<class F >
H3DUtil::H3DTan (F d)
Returns the tangent of d.
template<class F >
H3DUtil::H3DTanh (F d)
Returns the hyperbolic tangent of d.
template<class F >
H3DUtil::H3DAtan (F d)
Returns the arctangent of d in the range -pi/2 to pi/2 radians.
template<class F >
H3DUtil::H3DAtan2 (F y, F x)
Returns the arctangent of y/x in the range -pi to pi radians.
template<class F >
H3DUtil::H3DFloor (F f)
Returns the largest integer that is not greater than f.
template<class F >
H3DUtil::H3DCeil (F f)
Returns the smallest integer greater than or equal to f.

## Detailed Description

Different functions used for mathematics.

## Function Documentation

template<class F >
 F H3DUtil::H3DAbs ( F f ) ` [inline]`

template<class F >
 F H3DUtil::H3DAcos ( F d ) ` [inline]`

Returns the arccosine of d.

template<class F >
 F H3DUtil::H3DAsin ( F d ) ` [inline]`

Returns the arcsine of d.

template<class F >
 F H3DUtil::H3DAtan ( F d ) ` [inline]`

Returns the arctangent of d in the range -pi/2 to pi/2 radians.

If d is 0, o is returned.

template<class F >
 F H3DUtil::H3DAtan2 ( F y, F x ) ` [inline]`

Returns the arctangent of y/x in the range -pi to pi radians.

If both parameters of atan2 are 0, 0 is returned. H3DAtan2 is well defined for every point other than the origin, even if x equals 0 and y does not equal 0.

template<class F >
 F H3DUtil::H3DCeil ( F f ) ` [inline]`

Returns the smallest integer greater than or equal to f.

Referenced by H3DUtil::Image::getSample().

template<class F >
 F H3DUtil::H3DCos ( F d ) ` [inline]`

template<class F >
 F H3DUtil::H3DCosh ( F d ) ` [inline]`

Returns the hyperbolic cosine of d.

template<class F >
 F H3DUtil::H3DExp ( F f ) ` [inline]`

Returns the exponential function of f.

template<class F >
 F H3DUtil::H3DFloor ( F f ) ` [inline]`

Returns the largest integer that is not greater than f.

Referenced by H3DUtil::RGB::fromHSV(), and H3DUtil::Image::getSample().

template<class F >
 F H3DUtil::H3DLog ( F f ) ` [inline]`

Returns the natural logarithm of f.

template<class F >
 F H3DUtil::H3DLog10 ( F f ) ` [inline]`

Returns the base 10 logarithm of f.

template<class A >
 A H3DUtil::H3DMax ( const A & a, const A & b ) ` [inline]`

Returns the maximum value of a and b.

Referenced by H3DUtil::RGB::toHSV().

template<class A >
 A H3DUtil::H3DMin ( const A & a, const A & b ) ` [inline]`

Returns the minimum value of a and b.

Referenced by H3DUtil::RGB::toHSV().

 double H3DUtil::H3DPow ( int f, int t ) ` [inline]`

Returns f raised to the power of t.

template<class F , class T >
 F H3DUtil::H3DPow ( F f, T t ) ` [inline]`

Returns f raised to the power of t.

template<class F >
 F H3DUtil::H3DSin ( F d ) ` [inline]`

template<class F >
 F H3DUtil::H3DSinh ( F d ) ` [inline]`

Returns the hyperbolic sine of d.

template<class F >
 F H3DUtil::H3DSqrt ( F f ) ` [inline]`

template<class F >
 F H3DUtil::H3DTan ( F d ) ` [inline]`

Returns the tangent of d.

template<class F >
 F H3DUtil::H3DTanh ( F d ) ` [inline]`

Returns the hyperbolic tangent of d.

 bool H3DUtil::isPowerOfTwo ( unsigned int i ) ` [inline]`

Determines if the given integer is a power of two or not.

 unsigned int H3DUtil::nextPowerOfTwo ( unsigned int i ) ` [inline]`

If i is a power of two, i is returned.

Otherwise the first power of two greater that i is returned.

Generated on Fri Nov 7 10:23:39 2008 for H3DUtil by  1.5.7