Functions | |
FARSA_UTIL_TEMPLATE float | invLinearMap (float x, float min=-10, float max=10, float outMin=-1, float outMax=1) |
Inversed Linear mapping from [min,max] to [outMin, outMax]. More... | |
FARSA_UTIL_TEMPLATE float | linearMap (float x, float min=-10, float max=10, float outMin=-1, float outMax=1) |
Linear mapping from [min,max] to [outMin, outMax]. More... | |
template<class T , class U > | |
FARSA_UTIL_TEMPLATE const T | max (const T &t1, const U &t2) |
Template for max calculation. More... | |
template<class T , class U > | |
FARSA_UTIL_TEMPLATE const T | min (const T &t1, const U &t2) |
Template for min calculation. More... | |
FARSA_UTIL_TEMPLATE real | normalizeDegree (real x) |
Restricts the angle between -180° and 180° More... | |
FARSA_UTIL_TEMPLATE real | normalizeDegree0360 (real x) |
Restricts the angle between 0.0° and 360° More... | |
FARSA_UTIL_TEMPLATE real | normalizeRad (real x) |
Restricts the angle between -PI_GRECO and PI_GRECO. More... | |
FARSA_UTIL_TEMPLATE real | normalizeRad02pi (real x) |
Restricts the angle between 0.0 and 2.0 * PI_GRECO. More... | |
FARSA_UTIL_TEMPLATE real | ramp (real minv, real maxv, real value) |
Clamps the value of a variable in the given range. More... | |
FARSA_UTIL_TEMPLATE real | toDegree (real x) |
Converts radians to degrees. More... | |
FARSA_UTIL_TEMPLATE real | toRad (real x) |
Converts degrees to radians. More... | |
Detailed Description
Function Documentation
|
inline |
Inversed Linear mapping from [min,max] to [outMin, outMax].
--------\ outMax \ -------- outMin min max
- Parameters
-
x the value to map min the minumum allowed value of x max the maximum allowed value of x outMin the minimum value of the mapped value outMax the maximum value of the mapped value
- Returns
- the mapped value
Definition at line 232 of file mathutils.h.
References farsa::max(), and farsa::min().
|
inline |
Linear mapping from [min,max] to [outMin, outMax].
/-------- outMax / --------/ outMin min max
- Parameters
-
x the value to map min the minumum allowed value of x max the maximum allowed value of x outMin the minimum value of the mapped value outMax the maximum value of the mapped value
- Returns
- the mapped value
Definition at line 201 of file mathutils.h.
References farsa::max(), and farsa::min().
FARSA_UTIL_TEMPLATE const T farsa::max | ( | const T & | t1, |
const U & | t2 | ||
) |
Template for max calculation.
- Parameters
-
t1 the first element to compare t2 the second element to compare
- Returns
- the maxumum between t1 and t2
Definition at line 154 of file mathutils.h.
Referenced by farsa::invLinearMap(), farsa::linearMap(), Intervals::unite(), and DataStreamPlot::updatePlot().
FARSA_UTIL_TEMPLATE const T farsa::min | ( | const T & | t1, |
const U & | t2 | ||
) |
Template for min calculation.
- Parameters
-
t1 the first element to compare t2 the second element to compare
- Returns
- the minumum between t1 and t2
Definition at line 136 of file mathutils.h.
Referenced by farsa::invLinearMap(), farsa::linearMap(), Intervals::unite(), and DataStreamPlot::updatePlot().
|
inline |
Restricts the angle between -180° and 180°
- Parameters
-
x the angle to restrict
- Returns
- the angle restricted between -180° and 180°
Definition at line 121 of file mathutils.h.
References farsa::normalizeDegree0360().
|
inline |
Restricts the angle between 0.0° and 360°
- Parameters
-
x the angle to restrict
- Returns
- the angle restricted between 0.0° and 360°
Definition at line 109 of file mathutils.h.
Referenced by farsa::normalizeDegree().
|
inline |
Restricts the angle between -PI_GRECO and PI_GRECO.
- Parameters
-
x the angle to restrict
- Returns
- the angle restricted between -PI_GRECO and PI_GRECO
Definition at line 84 of file mathutils.h.
References farsa::normalizeRad02pi().
|
inline |
Restricts the angle between 0.0 and 2.0 * PI_GRECO.
- Parameters
-
x the angle to restrict
- Returns
- the angle restricted between 0.0 and 2.0 * PI_GRECO
Definition at line 72 of file mathutils.h.
Referenced by farsa::normalizeRad().
Clamps the value of a variable in the given range.
- Parameters
-
minv the minimum value of the range maxv the maximum value of the range value the value to constraint
- Returns
- if value is greater than maxv, returns the maxv, if value is less than minv, returns minv, otherwise returns value
Definition at line 173 of file mathutils.h.
|
inline |
Converts radians to degrees.
- Parameters
-
x the angle in radians
- Returns
- the angle in degrees
Definition at line 97 of file mathutils.h.
|
inline |
Converts degrees to radians.
- Parameters
-
x the ange in degrees
- Returns
- the angle in radians
Definition at line 60 of file mathutils.h.