Created
January 9, 2023 14:56
-
-
Save tomdewildt/9e0d0e2f157dc51bebd5d77ffe1aaa38 to your computer and use it in GitHub Desktop.
Common functions for the python programming language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Map number from one range to another range | |
def map(value, from_min, from_max, to_min, to_max): | |
return (value - from_min) * (to_max - to_min) / (from_max - from_min) + to_min; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment