# Change of coordinate codomain from $[-1,1]$ to $[0,1]$

How does one translate coordinates from $[-1,1]$ to $[0,1]$? That is, suppose we have an ordered pair $(x,y)$ which lies between $[-1,1]$ and want to push into the range delimited by $[0,1]$.

A lot of places does the transformation something like this:

$$f(u) = ((u_1 + 1)/2)i + ((u_2 +1)/2)j$$

I'm not even sure if I may express it this way (?), here's the usual expression:

$$x = (c_x + 1) / 2$$ $$y = (c_y + 1) / 2$$

I can see that that the addition of $1$ will force all the possible inputs into the $[0,2]$ range and that the division by the maximum of the range will force it to be expressed as a part of the whole, the whole being the dimensionless $1$, effectively expressing all values in the range of $[0,1]$.

Is this all there is to this? Just a heuristic, trial and error technique until you get what you want? Or is there a more obvious, better, formalized way?

-
Looks good to me. $x=\left( (c_x+1)/2 \right)^m$, with $m\in\Bbb{N}_+$ would also do, but why not keeping simple things simple... – draks ... Apr 23 '12 at 14:00
– Martin Sleziak Feb 17 '15 at 11:00

Yes, $t\mapsto (t+1)/2$ transforms $[-1,1]$ to $[0,1]$. That's all there is to it.
For the general case of transforming $[a,b]$ to $[c,d]$, you can write $t\mapsto ut+v$ and solve $ua+v=c$ and $ub+v=d$ to find $u$ and $v$.