Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

P5 map function

p5.prototype.map = function(n, start1, stop1, start2, stop2) {
  return ((n-start1)/(stop1-start1))*(stop2-start2)+start2;
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #map #function
ADD COMMENT
Topic
Name
5+5 =