Skip to content

Instantly share code, notes, and snippets.

@fernoe1
Created March 28, 2026 18:45
Show Gist options
  • Select an option

  • Save fernoe1/f32716a0515e00092a21ecc7b2d766f8 to your computer and use it in GitHub Desktop.

Select an option

Save fernoe1/f32716a0515e00092a21ecc7b2d766f8 to your computer and use it in GitHub Desktop.
float remap(float value, float originMin, float originMax, float destinationMin, float destinationMax) {
return destinationMin + (value - originMin) * (destinationMax - destinationMin) / (originMax - originMin);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment