mapRange function
Map a given value between a range
Implementation
double mapRange(
double value,
double iMin,
double iMax, [
double oMin = 0,
double oMax = 1,
]) {
return ((value - iMin) * (oMax - oMin)) / (iMax - iMin) + oMin;
}
Map a given value between a range
double mapRange(
double value,
double iMin,
double iMax, [
double oMin = 0,
double oMax = 1,
]) {
return ((value - iMin) * (oMax - oMin)) / (iMax - iMin) + oMin;
}