Last active
          October 12, 2021 14:32 
        
      - 
      
 - 
        
Save said-and-done/3a091a41a527c212b3f31e7c8c2196d4 to your computer and use it in GitHub Desktop.  
    Linear map input domain to output range
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | function linearmap(inMin, inMax, outMin, outMax) { | |
| return function (x) { | |
| return (x - inMin) * (outMax - outMin) / (inMax - inMin) + outMin; | |
| }; | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment