I have these values, all these values are in the range between $0$ and $1 (0, +1)$.
- $0.3$
- $0.5$
- $0.8$
- $0.9$
I want to change (translate) these values to a new range between $-1$ and $+1$ $(-1, +1)$, so I use the formula $y=2(x-0.5)$ (the magical number $2$ should expand the range to its extremes $(-1,+1)$ without disturbing the relations between the numbers):
- $2 (0.3 - 0.5) = -0.4$
- $2 (0.2 - 0.5) = -0.6$
- $2 (0.8 - 0.5) = +0.6$
- $2 (0.9 - 0.5) = +0.8$
Imagine I have other values from other ranges which I want to translate to the new domain $(-1,+1)$, so "$y=2(x-0.5)$" does not work for these ranges.
Are there any kind of (abstract) formula to make such translations?