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?
For domain $(a,b)$, the formula is of the form of
$$y = p(x-m)$$
where $m =\frac{a+b}2$ and $p= \frac{1}{m-a}$.
Try to interpret the meaning of $m$ and $p$ for better understanding of the formula.
Exercise (to get another perspective):
Try to find the straight line that connects $(0,-1)$ to $(1,1)$.
Try to find the straight line that connects $(a,-1)$ to $(b,1)$.