mapRange function

double mapRange(
  1. double value,
  2. double fromMin,
  3. double fromMax,
  4. double toMin,
  5. double toMax,
)

Implementation

double mapRange(double value, double fromMin, double fromMax, double toMin, double toMax) {
  final double t = inverseLerp(fromMin, fromMax, value);
  return lerp(toMin, toMax, t);
}