map function

double map(
  1. double x,
  2. double minOut,
  3. double maxOut
)

Implementation

double map(double x, double minOut, double maxOut) {
  return x * (maxOut - minOut) + minOut;
}