normalize function

double normalize(
  1. double t,
  2. double min,
  3. double max
)

Normalizes t value by min and max values

Implementation

double normalize(double t, double min, double max) {
  return (t - min) / (max - min);
}