Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mccap079/77560805982635c5c5c9c94ec74530d3 to your computer and use it in GitHub Desktop.
Save mccap079/77560805982635c5c5c9c94ec74530d3 to your computer and use it in GitHub Desktop.
float map(float value, float min1, float max1, float min2, float max2)
{
return min2 + (value - min1) * (max2 - min2) / (max1 - min1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment