Skip to content

Instantly share code, notes, and snippets.

@paulate
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save paulate/9227881 to your computer and use it in GitHub Desktop.

Select an option

Save paulate/9227881 to your computer and use it in GitHub Desktop.
//map function
function map(value, start1, stop1, start2, stop2) {
var mappedValue = ((value-start1)/(stop1 - start1))*(stop2-start2)+start2;
return mappedValue;
}
@paulate
Copy link
Author

paulate commented Feb 26, 2014

port of map() from processing, http://www.processing.org/reference/map_.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment