Skip to content

Instantly share code, notes, and snippets.

@theoknock
Last active August 28, 2020 19:39
Show Gist options
  • Save theoknock/f21629dc845929a39730814024317ac6 to your computer and use it in GitHub Desktop.
Save theoknock/f21629dc845929a39730814024317ac6 to your computer and use it in GitHub Desktop.
Scales values within a given range to a value between 0 and 1 (normalization)
double (^normalize)(double, double, double) = ^double(double min, double max, double value)
{
double result = (value - min) / (max - min);
return result;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment