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

I have been given equations for converting from a global to local coordinate system in 2 dimensions, however with no explanation/proof as to how the equation is obtained. I realise that on occasion you just need to learn an equation and use it, but in this case I would really appreciate it if someone could help me understand what's going on. They are as follows:

$$x = X \cos \theta + Y \sin \theta$$ $$y = -X \sin \theta + Y \cos \theta$$

Where (x,y) are the local coordinates of the global point (X,Y) and $ \theta$ is the orientation of the local system relative to the global system.

share|cite|improve this question
up vote 0 down vote accepted

This transformation can be described as the multiplication of a vector by a matrix. This matrix is a rotation matrix scaled by $(X, Y)$. Its effect is to rotate $(x,y)$ by $\theta$ (about the origin), then scale by $(X,Y)$.

share|cite|improve this answer
Out of interest. The rotation matrix given in Wikipedia produces the equations: $x = X \cos \theta - Y \sin \theta$ and $y = X \sin \theta + Y \cos \theta$ is this rotation ccw as opposed to cw? – baseten Jan 11 '12 at 11:16

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.