Skip to content

Instantly share code, notes, and snippets.

@TomoG29
Last active January 13, 2019 04:48
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 TomoG29/323cdbd9ed9ed96131721154ed9eec55 to your computer and use it in GitHub Desktop.
Save TomoG29/323cdbd9ed9ed96131721154ed9eec55 to your computer and use it in GitHub Desktop.
public static float map(float value, float start1, float end1, float start2, float end2)
{
return (start2 + (end2 - start2) * ((value - start1) / (end1 - start1)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment