Skip to content

Instantly share code, notes, and snippets.

@pif
Created March 29, 2011 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pif/892391 to your computer and use it in GitHub Desktop.
Save pif/892391 to your computer and use it in GitHub Desktop.
MAP method
static public final float map(float value,
float istart, float istop,
float ostart, float ostop) {
return ostart + (ostop - ostart) * ((value - istart) / (istop - istart));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment