Simplifying trigonometric equation that represents a 2D vector rotation

40 Views Asked by At

Recently I forgot what the matrix formula was for the rotation of a 2D vector. i.e what is the value of $R$ based on $\alpha$ in the following formula:

$$R*\overrightarrow{v} = \overrightarrow{w}$$ (Assuming that $R$ is a transformation matrix describing a rotation.)

I now know that it is: $$x' = x*cos(\alpha) - y*sin(\alpha)$$ $$y' = x*sin(\alpha) + y*cos(\alpha)$$

But in the process to try to derive the formula I came up with the following convoluted and unnccesarry long plan:

  • I know how to rotate a vector which is aligned with one axis
  • I know how to get the rotation angle between the X axis and $\overrightarrow{v}$
  • And I know how to get the length of $\overrightarrow{v}$

Assuming that $\beta$ is the angle between the X axis and $\overrightarrow{v}$ and that $l$ is the length of the vector $\overrightarrow{v}$. The following formula might work for a rotation of the vector $\overrightarrow{v}$ under the angle of $\alpha$: $$x'=cos(\alpha+\beta)*l$$ $$y'=sin(\alpha+\beta)*l$$ We know that $l = \sqrt{x^2+y^2}$ and that $\beta = \tan^{-1}{(y/x)}$: $$x'=cos(\alpha + \tan^{-1}{(y/x)}) * \sqrt{x^2+y^2}$$ $$y'=sin(\alpha + \tan^{-1}{(y/x)}) * \sqrt{x^2+y^2}$$ Here comes the question: This phrase probably gets said a lot of times but wolfram alpha has indeed simplified these two latest equations into the textbook formula mentioned at the start. As wolfram alpha often does, there are no steps or explanations into how one might simplify such a ugly equation and my trigonometry is quite lacking, so what is the process of simplifying the above last two equations into the textbook form?

1

There are 1 best solutions below

2
On BEST ANSWER

As a sketch of how it would work, we would start by applying the sum of angle formulae:

$$\begin{eqnarray} \cos(\theta + \phi) & = & \cos \theta \cos \phi - \sin \theta \sin \phi \\ \sin(\theta + \phi) & = & \sin \theta \cos \phi + \cos \theta \sin \phi\end{eqnarray}$$

That will split both of your expressions into terms that start to look like the required result.

The second step will be to transform the terms that look like $\left(\cos \tan^{-1} \frac{y}{x}\right) \sqrt{x^2 + y^2}$, and the way we'll do that is by thinking about a right-angled triangle.

A right-angled triangle, with base length x and height y, with the angle between the base and hypotenuse labelled theta.

In this triangle, we know that $\tan \theta = \frac{y}{x}$. So that means we can write $\theta = \tan^{-1} \frac{y}{x}$. But also, we can find the hypotenuse as $\sqrt{x^2 + y^2}$ and write $\cos \theta = \frac{x}{\sqrt{x^2 + y^2}}$, so $\cos \tan^{-1} \frac{y}{x} = \frac{x}{\sqrt{x^2 + y^2}}$. We can do something similar for $\sin \theta$, and those should give you all you need to finish off the proof.