Worldsim Utility Functions

These functions are globally availables, just include worldsimconfig.h to use them. More...

Functions

FARSA_WSIM_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].
 
FARSA_WSIM_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].
 
template<class T , class U >
FARSA_WSIM_TEMPLATE const T max (const T &t1, const U &t2)
 Template for max calculation.
 
template<class T , class U >
FARSA_WSIM_TEMPLATE const T min (const T &t1, const U &t2)
 Template for min calculation.
 
FARSA_WSIM_TEMPLATE real ramp (real minv, real maxv, real value)
 Function for imposing a range for a real variable.
 
FARSA_WSIM_TEMPLATE real toDegree (real x)
 convert radians to degree
 
FARSA_WSIM_TEMPLATE real toRad (real x)
 convert degree to radians
 

Detailed Description

These functions are globally availables, just include worldsimconfig.h to use them.

Function Documentation

FARSA_WSIM_TEMPLATE float farsa::invLinearMap ( float  x,
float  min = -10,
float  max = 10,
float  outMin = -1,
float  outMax = 1 
)
inline

Inversed Linear mapping from [min,max] to [outMin, outMax].

  -----—\             outMax
           \
            -----—   outMin
       min   max
  

Definition at line 149 of file worldsimconfig.h.

References farsa::max(), and farsa::min().

FARSA_WSIM_TEMPLATE float farsa::linearMap ( float  x,
float  min = -10,
float  max = 10,
float  outMin = -1,
float  outMax = 1 
)
inline

Linear mapping from [min,max] to [outMin, outMax].

            /-----—  outMax
           /
  -----—/            outMin
       min   max
 

Definition at line 130 of file worldsimconfig.h.

References farsa::max(), and farsa::min().

FARSA_WSIM_TEMPLATE const T farsa::min ( const T &  t1,
const U &  t2 
)
FARSA_WSIM_TEMPLATE real farsa::ramp ( real  minv,
real  maxv,
real  value 
)
inline