Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have a Cartesian coordinate system that is rotated and translated relative to another Cartesian coordinate system. I would like to be able to take any (x,y) in the first system and calculate the equivalent (x,y) in the second one. The coordinate systems have the same units and scale, so only a translation and rotation is applied.

This should just be 'simple' trigonometry, but I can't seem to get anything to work.

Any suggestions?



share|improve this question
add comment

1 Answer 1

Ignore the points $A,B,C,D$ in the following sketch.

enter image description here

The translation corresponds to the change of variables

$$x=\overline{x}+X,\qquad y=\overline{y}+Y,\tag{1}$$

and the rotation corresponds to

$$X=x^{\prime }\cos \theta -y^{\prime }\sin \theta,\qquad Y=x^{\prime }\sin \theta +y^{\prime }\cos \theta .\tag{2}$$

If you combine $(1)$ and $(2)$, you get

$$x=\overline{x}+x^{\prime }\cos \theta -y^{\prime }\sin \theta,\qquad y=\overline{y}+x^{\prime }\sin \theta +y^{\prime }\cos \theta .\tag{3}$$

You can invert this system of equations to get $x',y'$ in terms of $x,y$ and $\overline{x},\overline{y}$:

$$x^{\prime }=x\cos \theta +y\sin \theta -\overline{x}\cos \theta -\overline{y}\sin \theta \tag{4a}$$

$$y^{\prime }=-x\sin \theta +y\cos \theta +\overline{x}\sin \theta -\overline{y}\cos \theta .\tag{4b}$$

The rotation and the translation transformation can be expressed by matrices. The rotation transformation in two dimensions is described in this Wikipedia section.

share|improve this answer
Thank you very much! –  Gerald Jun 19 '12 at 0:10
@Gerald You are welcome! –  Américo Tavares Jun 19 '12 at 0:44
add comment

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.