Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|cite|improve this question
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

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$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.