Translate a number n from the range min1, max1 to the range min2, max2
n
min1, max1
min2, max2
The number to translate
The minimum value from the initial range
The maximum value from the initial range
The minimum value for the final range
The maximum value for the final range
A translated number in the final range
const C = 20, F = SMath.translate(C, 0, 100, 32, 212); // 68 Copy
const C = 20, F = SMath.translate(C, 0, 100, 32, 212); // 68
Translate a number
n
from the rangemin1, max1
to the rangemin2, max2