# Rotation about the origin

#### Mondo

##### New member
I came across the equations describing the rotation of a point around the origin - they claim that the new coordinates, after the rotation are as follows:
$$\displaystyle x' = xcos(\theta) - ysin(\theta)$$
$$\displaystyle y' = xsin(\theta) + ycos(\theta)$$

I sketched a circle with two vectors inside but I can't get that. How can I derive this equation?

Thanks

#### JeffM

##### Elite Member
Suppose $$\displaystyle x = cos(\phi) \text { and } y = sin( \phi).$$

Now we rotate by theta.

$$\displaystyle x’ = cos(\phi + \theta) = cos(\phi) cos(\theta) - sin(\phi) sin( \theta) = x cos( \theta) - y sin(\theta), \text { and}$$

$$\displaystyle y’ = sin(\phi + \theta) = sin(\phi) cos(\theta) + cos(\phi) sin( \theta) = ycos(\theta) + x sin(\theta).$$

It is just the sum of angles formulae.

• Mondo and lex

#### pka

##### Elite Member
I came across the equations describing the rotation of a point around the origin - they claim that the new coordinates, after the rotation are as follows:
$$\displaystyle x' = xcos(\theta) - ysin(\theta)$$
$$\displaystyle y' = xsin(\theta) + ycos(\theta)$$ How can I derive this equation?
One cannot just jump in and derive that rotation. It requires background that is more than vectors.
Go to a reasonably good mathematics library, see if James Smart's book Modern Geometries is in the collection.
If so look for chapter 2. It contains a detail discussion. Other wise, mot textbooks for analytical geometry will contain some thing about this concept.

Last edited:

#### Harry_the_cat

##### Elite Member
If you are familiar with matrices, you'll know that the matrix associated with a rotation of $$\displaystyle A$$ is given by
$$\displaystyle \begin{pmatrix} cos A & -sin A\\\ sin A & cos A \end{pmatrix}$$
The columns in this rotation matrix are simple the images of the vectors (respectively) i and j under the rotation of $$\displaystyle A$$.

PS. Can someone please tell me how I can get the sin A on the second row to line up???

Last edited by a moderator:
• lex

#### jonah2.0

##### Full Member
Beer inspired conjecture follows.
If you are familiar with matrices, you'll know that the matrix associated with a rotation of $$\displaystyle A$$ is given by
$$\displaystyle \begin{pmatrix} cos A & -sin A\\ sin A & cos A \end{pmatrix}$$
The columns in this rotation matrix are simple the images of the vectors (respectively) i and j under the rotation of $$\displaystyle A$$.

PS. Can someone please tell me how I can get the sin A on the second row to line up???
$$\displaystyle \begin{pmatrix} cos A & -sin A\\\ sin A & cos A \end{pmatrix}$$

• Subhotosh Khan

#### Mondo

##### New member
JeffM, thanks! Great explanation Harry_the_cat, mentioned the matrices but I think they were constructed just from that cosine formula derivation, right?

#### JeffM

##### Elite Member
JeffM, thanks! Great explanation Harry_the_cat, mentioned the matrices but I think they were constructed just from that cosine formula derivation, right?
I believe that the matrix form expresses concisely and simply in the notation of linear algebra the same conclusion that I derived and expressed using elementary trigonometry. Whether the derivation is ”fundamentally the same,” I do not know. Pka seems to suggest that there are subtleties involved in the concept of rotation in a vector space that my simple explanation ignores.

#### Harry_the_cat

##### Elite Member
JeffM, thanks! Great explanation Harry_the_cat, mentioned the matrices but I think they were constructed just from that cosine formula derivation, right?
The images of the vectors i and j under a rotation of A (which form the columns of the rotation matrix) are derived using simple right-angled triangle trigonometry. Draw a diagram and you'll see what I mean.

#### Harry_the_cat

##### Elite Member
Beer inspired conjecture follows.

$$\displaystyle \begin{pmatrix} cos A & -sin A\\\ sin A & cos A \end{pmatrix}$$
still does it

#### jonah2.0

##### Full Member
Beer soaked discovery follows.
Beer inspired conjecture follows.

$$\displaystyle \begin{pmatrix} cos A & -sin A\\\ sin A & cos A \end{pmatrix}$$
still does it
Apparently, the forum has a glitch.
When you quote my mild tweak, you don't get the sin A on the second row to line up
$$\displaystyle \begin{pmatrix} cos A & -sin A\\\ sin A & cos A \end{pmatrix}$$
Without, they line up
$$\displaystyle \begin{pmatrix} cos A & -sin A\\\ sin A & cos A \end{pmatrix}$$

#### JeffM

##### Elite Member
@Mondo

Having glanced at the wiki article you cited, I saw one complexity that I had implicitly assumed away (as had whatever you were quoting). That implicit assumption is

$$\displaystyle x^2 + y^2 = 1$$.

That is, I was thinking of a unit circle. That is not a general case (although the general case can be reduced to a unit circle by a change in scale).

I really should have said

$$\displaystyle sin(\phi) = \dfrac{y}{\sqrt{x^2 + y^2}} \text { and } cos(\phi) = \dfrac{x}{\sqrt{x^2 + y^2}}.$$

$$\displaystyle \text {Let } r = \sqrt{x^2 + y^2} \implies y = r sin(\phi) \text { and } x = r cos (\phi).$$

Now things progress as before except for the scale factor of r.

• Mondo

#### Jomo

##### Elite Member
Suppose $$\displaystyle x = cos(\phi) \text { and } y = sin( \phi).$$

Now we rotate by theta.

$$\displaystyle x’ = cos(\phi + \theta) = cos(\phi) cos(\theta) - sin(\phi) sin( \theta) = x cos( \theta) - y sin(\theta), \text { and}$$

$$\displaystyle y’ = sin(\phi + \theta) = sin(\phi) cos(\theta) + cos(\phi) sin( \theta) = ycos(\theta) + x sin(\theta).$$

It is just the sum of angles formulae.
Jeff,
Your work looked good until I realized that it does not give the correct matrix, else I am missing something.
$$\displaystyle \begin{pmatrix} cos A & -sin A\\\ sin A & cos A \end{pmatrix}$$

#### JeffM

##### Elite Member
Jeff,
Your work looked good until I realized that it does not give the correct matrix, else I am missing something.
$$\displaystyle \begin{pmatrix} cos A & -sin A\\\ sin A & cos A \end{pmatrix}$$
I think I am ok. To make the linear algebra magic come out right, I think you just need to reverse the order of the terms in my second equation. I never formally learned linear algebra, just picked things up about it from abstract algebra.

#### Jomo

##### Elite Member
No, AX=AX, you can't reverse the variables of just one row. Actually multiply out the rotating matrix that the cat posted by (x, y)T and see if you get the same answer with your matrix.

What you are saying is basically that
3x + 4y =11
2x - 3y = 22

and
3x + 4y = 11
-3x + 2y = 22

are the same systems. I'm sure that you know that is not true.

#### JeffM

##### Elite Member
I still do not see an error in my trigonometry. And I did not try to translate my results into matrix notation. But I think you misunderstood what I was getting at. I had

$$\displaystyle x’ = x cos( \theta) - y sin(\theta) \text { and } y’ = ycos(\theta) + x sin(\theta).$$

I did not have x and y in the same order in my two equations. What I suspect is that if you order my two equations consistently, whatever you are doing will work.

$$\displaystyle x’ = x cos( \theta) - y sin(\theta) \text { and } y’ = x sin(\theta) + ycos(\theta).$$

#### Jomo

##### Elite Member
I am tex disabled. Can someone please post the matrix which the cat posted times (x y)T and the matrix that comes from Jeff's equations times (x y)T

#### JeffM

##### Elite Member
No, AX=AX, you can't reverse the variables of just one row. Actually multiply out the rotating matrix that the cat posted by (x, y)T and see if you get the same answer with your matrix.

What you are saying is basically that
3x + 4y =11
2x - 3y = 22

and
3x + 4y = 11
-3x + 2y = 22

are the same systems. I'm sure that you know that is not true.
No. What I am saying is that

3x + 4y = 11
-3y + 2x = 22

is the same system as

3x + 4y = 11
2x - 3y = 22

And if linear algebra says that those are different, then linear algebra is nonsense.

I have this vague recollection that you need to order the variables consistently for purposes of linear algebra, but there is no point in relying on my half-baked recollections.

#### JeffM

##### Elite Member
@Mondo

As far as I can see, I answered your original question using basic trigonometry and the unit circle. No one has shown where that is in error. It seems to me that Jomo, who is so far the only one to claim my derived result is contradicted by linear algebra, really should show a derivation using linear algebra and exactly where it it differs from mine.

It does not seem reasonable to me that people say my result is wrong but cannot show where it is wrong.

• Mondo