remap method

double remap(
  1. double from1,
  2. double to1,
  3. double from2,
  4. double to2,
)

Implementation

double remap(
  double from1,
  double to1,
  double from2,
  double to2,
) =>
    (this - from1) / (to1 - from1) * (to2 - from2) + from2;