Algebra3D
Algebra for 3D transformations
 All Classes Namespaces Files Functions Variables Typedefs Macros
Namespaces | Macros | Functions
global.h File Reference
#include <limits>
#include <cmath>
#include <ostream>
#include <istream>

Go to the source code of this file.

Namespaces

 algebra3d
 A namespace for the whole library.
 

Macros

#define _PRECISION(FP_TYPE)
 
#define PRECISION   _PRECISION(fpType)
 
#define PRECISION_D   _PRECISION(double)
 
#define PRECISION_F   _PRECISION(float)
 
#define _INF(FP_TYPE)   (std::numeric_limits<FP_TYPE>::infinity())
 
#define INF   _INF(fpType)
 
#define INF_D   _INF(double)
 
#define INF_F   _INF(float)
 
#define N_A_N   (INF - INF)
 
#define N_A_N_D   (INF_D - INF_D)
 
#define N_A_N_F   (INF_F - INF_F)
 

Functions

template<class fpType >
int algebra3d::sign (const fpType &val)
 
template<class fpType >
int algebra3d::signStar (const fpType &val)
 
template<class fpType >
bool algebra3d::isInf (const fpType &number)
 
template<class fpType >
bool algebra3d::isNaN (const fpType &number)
 
template<class fpType >
int algebra3d::compare (const fpType &d1, const fpType &d2, const fpType &precision=PRECISION)
 
template<class fpType >
fpType algebra3d::normalizeAngle (const fpType &angle)
 
template<class fpType >
fpType algebra3d::getAngleFromSinCose (fpType sinAlpha, fpType cosAlpha)
 

Detailed Description

Global functions and declarations.

Macro Definition Documentation

#define _INF (   FP_TYPE)    (std::numeric_limits<FP_TYPE>::infinity())

Representation of infinity in floating point type given as parameter.

#define _PRECISION (   FP_TYPE)
Value:
( \
(sizeof(FP_TYPE) == sizeof(float)) * 1.0e-5 \
+ (sizeof(FP_TYPE) > sizeof(float)) * 1.0e-12\
)

The floating type to use (float or double) Default precision of comparison floating point type given as parameter. It is 1.0-12 for doubles and 1.0e-05 for floats.

#define INF   _INF(fpType)

Representation of infinity in different floating point types. Macro used within templates where fpType is the template parameter.

#define INF_D   _INF(double)

Representation of infinity in for double.

#define INF_F   _INF(float)

Representation of infinity in for float.

#define N_A_N   (INF - INF)

Representation of NaN in different floating point types (INF - INF). Macro used within templates where fpType is the template parameter.

#define N_A_N_D   (INF_D - INF_D)

Representation of NaN in for double (INF_D - INF_D).

#define N_A_N_F   (INF_F - INF_F)

Representation of NaN in for float (INF_F - INF_F).

#define PRECISION   _PRECISION(fpType)

Default precision of comparison for different floating point types. Macro used within templates where fpType is the template parameter.

#define PRECISION_D   _PRECISION(double)

Default precision for double.

#define PRECISION_F   _PRECISION(float)

Default precision for float.