Answers for "formula for map a number from one range to another"

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 "formula for map a number from one range to another"

Browse Popular Code Answers by Language