Worldsim Utility Functions

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

Functions

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

Detailed Description

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

Function Documentation

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().

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().

real farsa::ramp ( real  minv,
real  maxv,
real  value 
)
inline