Skip to content

Instantly share code, notes, and snippets.

@wuhhh
Created May 9, 2023 10:58
Show Gist options
  • Save wuhhh/2478a34ead157b56747462207e698ce9 to your computer and use it in GitHub Desktop.
Save wuhhh/2478a34ead157b56747462207e698ce9 to your computer and use it in GitHub Desktop.
float map(float value, float low1, float high1, float low2, float high2) {
return low2 + (value - low1) * (high2 - low2) / (high1 - low1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment