Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

map range of numbers to another range

const scale = (num, in_min, in_max, out_min, out_max) => {
  return (num - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
 
PREVIOUS NEXT
Tagged: #map #range #numbers #range
ADD COMMENT
Topic
Name
5+8 =