TCMathUtil.h File Reference

This file provides the definition of Math utilities in the namespace TC::Math. More...

#include "TCTypes.h"
#include "TCMathApi.h"
#include <cmath>
#include <limits>

Include dependency graph for TCMathUtil.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


Namespaces

namespace  TC
namespace  TC::Math
 TC::Math is intended to provide methods to perform common math operations.

Functions

template<class T >
TC::Math::Abs (const T &x)
template<class T >
TC::Math::Pow (T x, uint32 y)
 integer version of pow(.
uint32 TC::Math::Align32 (uint32 size)
 aligns a given number to 32
bool TC::Math::Compare (double val1, double val2)
 Compare two double values if equal by checking their difference.
uint32 TC::Math::Align16 (uint32 size)
 aligns a given number to 16
template<class T >
double TC::Math::Deg2Rad (T val)
 Function converts angle in degrees to angle in radians.
template<class T >
double TC::Math::Rad2Deg (T val)
 Function converts angle in radians to angle in degrees.
template<class T >
TC::Math::Normalize (T minValue, T maxValue, T value)
 Function converts a value in the range between minValue and maxValue to a value between 0 and one.
template<class T >
double TC::Math::SinXOverX (T x)
 This function calculates sin(x)/x in a safe way, i.e.
template<class T >
TC::Math::RoundToFirstSignificantValue (T val)
 Round any kind of value to the first significant value.
template<class T >
bool TC::Math::Compare (const T &val1, const T &val2)
 compare double or float value with its specified system epsilon
bool TC::Math::IsNaN (double val)
 function returns a true value if value is "not-a-number" (NaN), and false otherwise.
bool TC::Math::IsFinite (double val)
bool TC::Math::IsInf (double val)

Variables

const double TC::Math::PI = 3.1415926535897932385E0
 The constant value of PI.
const double TC::Math::MEGA_BYTES = 1024. * 1024.
 The constant value one Megabyte in bytes.


Detailed Description

This file provides the definition of Math utilities in the namespace TC::Math.

Author:
Thomas Goessler

Definition in file TCMathUtil.h.


Copyright (c) Thomas Goessler 2003 - 2008