mathutils.h
201 inline FARSA_UTIL_TEMPLATE float linearMap(float x, float min = -10, float max = 10, float outMin = -1, float outMax = 1)
232 inline FARSA_UTIL_TEMPLATE float invLinearMap(float x, float min = -10, float max = 10, float outMin = -1, float outMax = 1)
265 #define FARSA_TEST_NAN(__V__) if (isnan(__V__)) { qFatal("Variable " #__V__ " has and invalid value: NaN in %s at line %d", __FILE__, __LINE__); }
273 #define FARSA_TEST_INF(__V__) if (isinf(__V__)) { qFatal("Variable " #__V__ " has and invalid value: Infinite in %s at line %d", __FILE__, __LINE__); }
281 #define FARSA_TEST_INVALID(__V__) if (isnan(__V__)) { qFatal("Variable " #__V__ " has and invalid value: NaN in %s at line %d", __FILE__, __LINE__); } else if (isinf(__V__)) { qFatal("Variable " #__V__ " has and invalid value: Infinite in %s at line %d", __FILE__, __LINE__); }
This file contains the common type defitions used on the whole framework.
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].
Definition: mathutils.h:201
FARSA_UTIL_TEMPLATE real normalizeRad(real x)
Restricts the angle between -PI_GRECO and PI_GRECO.
Definition: mathutils.h:84
FARSA_UTIL_TEMPLATE real ramp(real minv, real maxv, real value)
Clamps the value of a variable in the given range.
Definition: mathutils.h:173
FARSA_UTIL_TEMPLATE real normalizeDegree0360(real x)
Restricts the angle between 0.0° and 360°
Definition: mathutils.h:109
FARSA_UTIL_TEMPLATE real normalizeRad02pi(real x)
Restricts the angle between 0.0 and 2.0 * PI_GRECO.
Definition: mathutils.h:72
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].
Definition: mathutils.h:232
FARSA_UTIL_TEMPLATE const T max(const T &t1, const U &t2)
Template for max calculation.
Definition: mathutils.h:154
FARSA_UTIL_TEMPLATE const T min(const T &t1, const U &t2)
Template for min calculation.
Definition: mathutils.h:136
FARSA_UTIL_TEMPLATE real normalizeDegree(real x)
Restricts the angle between -180° and 180°
Definition: mathutils.h:121