I know it should be trivial, but tonight I’m not finding a solution.
Suppose I have a series of float in a given range such [0.25, 1.0]. For example:
{0.25, 0.625, 1.0}
What’s the correct way to transform them in order to map the [0.25,1.0] interval to [0.0,1.0]?
The example sequence should become:
{0.0, 0.5, 1.0}
Second question, how to generalize that? How is the correct way to map a given interval [a,b] to [0,1]?
1 Answer