Answers for "how to map a range of numbers to another range"

1

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;
}
Posted by: Guest on August-15-2021

Code answers related to "how to map a range of numbers to another range"

Browse Popular Code Answers by Language