mapLinear<T extends num> static method

num mapLinear<T extends num>(
  1. T x,
  2. T a1,
  3. T a2,
  4. T b1,
  5. T b2,
)

Implementation

static num mapLinear<T extends num>(T x, T a1, T a2, T b1, T b2) {
  return b1 + (x - a1) * (b2 - b1) / (a2 - a1);
}