Class Mapper#
Defined in File Mapper.h
Class Documentation#
-
class Mapper#
Mapper is a bijective function f: [a,b] -> [c,d].
Mapper represent a mapping of from one interval to another: [a,b] -> [c,d]. It solves the linear equations
f(a) = r*a + s = c
f(b) = r*b + s = d for r and s so that it can determine f.
- Author
beyss
- Date
26.07.2017
Public Functions
-
inline Mapper(const std::pair<double, double> &in, const std::pair<double, double> &out)#
Creates a Mapper from two given intervals.
- Parameters:
in – the first interval
out – the second interval
-
inline double map(const double &out_val) const#
Returns the value associated to the given input using its linear mapping function.
- Parameters:
out_val – the value to map
- Returns:
the mapped value
-
inline double inverse(const double &in_val) const#
Returns the value associated to the given input using the inverse of its linear mapping function.
- Parameters:
in_val – the value to map
- Returns:
the mapped value