rangeScale function

double rangeScale(
  1. double amin,
  2. double amax,
  3. double bmin,
  4. double bmax,
  5. double b,
)

Implementation

double rangeScale(
        double amin, double amax, double bmin, double bmax, double b) =>
    amin + ((amax - amin) * ((b - bmin) / (bmax - bmin)));