2016-03-08 22:14:30 +01:00
|
|
|
#ifndef GB_SCALINGFUNCTIONS_H
|
|
|
|
#define GB_SCALINGFUNCTIONS_H
|
2016-03-04 14:57:46 +01:00
|
|
|
|
|
|
|
//simple y = f(x) functions, used for a variety of purposes.
|
|
|
|
|
2016-03-04 16:13:54 +01:00
|
|
|
//limit x into range [min_x..max_x], then scale linearly into [min_y..max_y]
|
2016-03-04 14:57:46 +01:00
|
|
|
double scale_linear(double x, double min_x, double max_x, double min_y, double max_y);
|
|
|
|
float scale_linear(float x, float min_x, float max_x, float min_y, float max_y);
|
|
|
|
|
|
|
|
|
2016-03-04 16:13:54 +01:00
|
|
|
//limit x into range [min_x..max_x], then scale using a quadratic expression into [min_y..max_y]
|
|
|
|
double scale_quadratic(double x, double min_x, double max_x, double min_y, double max_y);
|
|
|
|
|
2017-04-28 15:26:40 +02:00
|
|
|
|
|
|
|
//limit x into range [min_x..max_x], then scale logarithmically into [min_y..max_y]
|
|
|
|
double scale_logarithmically(double x, double min_x, double max_x, double min_y, double max_y);
|
|
|
|
|
|
|
|
|
2016-03-08 22:14:30 +01:00
|
|
|
#endif // GB_SCALINGFUNCTIONS_H
|