General math-related utility functions.
More...
#include <MathUtils.h>
General math-related utility functions.
- Author
- jwienke
Definition at line 39 of file MathUtils.h.
double rsc::math::MathUtils::degreeFromRadian |
( |
const double & |
radian | ) |
|
|
static |
Converts an angle given in radian to degrees.
- Parameters
-
- Returns
- angle in degree
Definition at line 68 of file MathUtils.cpp.
double rsc::math::MathUtils::getDefaultAnglePrecision |
( |
| ) |
|
|
static |
Default precision used for operations with angles in rad.
Definition at line 40 of file MathUtils.cpp.
double rsc::math::MathUtils::getDefaultClosePrecision |
( |
| ) |
|
|
static |
Returns the default precision used for isClose.
- Returns
- default precision
Definition at line 72 of file MathUtils.cpp.
double rsc::math::MathUtils::getTwoPi |
( |
| ) |
|
|
staticprivate |
bool rsc::math::MathUtils::isClose |
( |
const double & |
a, |
|
|
const double & |
b, |
|
|
const double & |
precision = getDefaultClosePrecision() |
|
) |
| |
|
static |
Checks two floating point numbers for equality using a specified tolerance.
- Parameters
-
a | first number to compare |
b | second number to compare |
precision | precision to use for the comparison, default is getDefaultClosePrecision |
- Returns
true
if
Definition at line 76 of file MathUtils.cpp.
bool rsc::math::MathUtils::isSameAngle |
( |
const double & |
firstInRad, |
|
|
const double & |
secondInRad, |
|
|
const double & |
precision = getDefaultAnglePrecision() |
|
) |
| |
|
static |
Tests if two given angles in rad are the same angle regarding things like etc.
- Parameters
-
firstInRad | first angle to test in rad |
secondInRad | second angle to test in rad |
precision | precision for the equality check in rad |
- Returns
true
if the difference of both angles is less than precision
, else false
Definition at line 56 of file MathUtils.cpp.
double rsc::math::MathUtils::normalizeAngle |
( |
const double & |
angleInRad | ) |
|
|
static |
Normalizes the given angle in rad to interval .
- Parameters
-
angleInRad | arbitrary angle in rad |
- Returns
- normalization of the angle to interval
Definition at line 44 of file MathUtils.cpp.
double rsc::math::MathUtils::radianFromDegree |
( |
const double & |
degree | ) |
|
|
static |
Converts an angle given in degrees to radian.
- Parameters
-
- Returns
- angle in rad
Definition at line 64 of file MathUtils.cpp.
The documentation for this class was generated from the following files: