Going from a value inside $[-1,1]$ to a value in another range

22.8k Views Asked by At

How does one calculate the value within range $-1.0$ to $1.0$ to be a number within the range of e.g. $0$ to $200$, or $0$ to $100$ etc. ?

1

There are 1 best solutions below

14
On BEST ANSWER

If you have numbers $x$ in the range $[a,b]$ and you want to transform them to numbers $y$ in the range $[c,d]$ you need to do this:

$$y=(x-a)\frac{d-c}{b-a}+c$$