Functions | Variables
MathToolbox.hpp File Reference
#include <math.h>
#include <cmath>
#include "../BasicDatatypes.hpp"
Include dependency graph for MathToolbox.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool fuzzyCompare (double a, double b)
 Tests if two double values are nearly equal. More...
 
bool fuzzyCompare (float a, float b)
 Tests if two float values are nearly equal. More...
 
double hypot (double x, double y, double z)
 
template<typename floatT >
bool isNaN (floatT x)
 Checks if a floating point value is Not-a-Number (NaN) More...
 
double normalizeRadians (double radians)
 
template<typename IntT >
IntT round_to_int (float floatValue)
 Round to the closest integer. More...
 
template<typename IntT >
IntT round_to_int (double floatValue)
 Round to the closest integer. More...
 
double sqr (double val)
 

Variables

const double NaN_double
 Not-a-Number in double precision. More...
 

Function Documentation

bool fuzzyCompare ( double  a,
double  b 
)
inline

Tests if two double values are nearly equal.

Returns
true if the two double numbers are equal in terms of the machine precision, which means their difference must be less than 1E-11.

Definition at line 28 of file MathToolbox.hpp.

bool fuzzyCompare ( float  a,
float  b 
)
inline

Tests if two float values are nearly equal.

Returns
true if the two float numbers are equal in terms of the machine precision, which means their difference must be less than 1E-6.

Definition at line 47 of file MathToolbox.hpp.

double hypot ( double  x,
double  y,
double  z 
)

Berechne die Laenge der Hypothenuse

Definition at line 19 of file MathToolbox.cpp.

template<typename floatT >
bool isNaN ( floatT  x)
inline

Checks if a floating point value is Not-a-Number (NaN)

The floating-point standard IEC 559 (a.k.a. IEEE 754) specifies that a floating-point value x represents NaN if x != x.

See also
NaN, NaN_double, http://en.wikipedia.org/wiki/IEC_559

Definition at line 63 of file MathToolbox.hpp.

double normalizeRadians ( double  radians)

Normalizes an angle given in radians by adding or subtracting an integer multiple of 2*pi so that the resulting angle is in the half-open interval [-pi,+pi). The current implementation takes O(1) time, i.e. the time of execution has a fixed upper boundary independend from the angle.

Definition at line 31 of file MathToolbox.cpp.

template<typename IntT >
IntT round_to_int ( float  floatValue)
inline

Round to the closest integer.

Parameters
floatValueThe float value that shall be rounded
Returns
floatValue rounded to the closest integer

Definition at line 74 of file MathToolbox.hpp.

template<typename IntT >
IntT round_to_int ( double  floatValue)
inline

Round to the closest integer.

Parameters
floatValueThe float value that shall be rounded
Returns
floatValue rounded to the closest integer

Definition at line 88 of file MathToolbox.hpp.

double sqr ( double  val)
inline

Definition at line 36 of file MathToolbox.hpp.

Variable Documentation

const double NaN_double

Not-a-Number in double precision.

Definition at line 13 of file MathToolbox.cpp.



libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Mon Oct 26 2020 03:27:30