# Thread: Multiply matrix

1. ## Multiply matrix

How too multiply 2 rotational matrices like this:
R(THETA2) . R(THETA1) = R(THETA1 +THETA2)

How would that look given the rotation matrix:
cos(THETA) -sin(THETA)
sin(THETA) COS(THETA)

2. Originally Posted by taurus
How too multiply 2 rotational matrices like this:
R(THETA2) . R(THETA1) = R(THETA1 +THETA2)

How would that look given the rotation matrix:
cos(THETA) -sin(THETA)
sin(THETA) COS(THETA)
$\displaystyle R(\theta_1)R(\theta_2) = \begin{bmatrix}\cos\theta_1&-\sin\theta_1\\ \sin\theta_1&\cos\theta_1\end{bmatrix} \begin{bmatrix}\cos\theta_2&-\sin\theta_2\\ \sin\theta_2&\cos\theta_2\end{bmatrix}$

$\displaystyle {\color{white}R(\theta_1)R(\theta_2)} = \begin{bmatrix}(\cos\theta_1\cos\theta_2 -\sin\theta_1\sin\theta_2) &(-\cos\theta_1\sin\theta_2-\sin\theta_1\cos\theta_2)\\ (\sin\theta_1\cos\theta_2+\cos\theta_1\sin\theta_2 )& (-\sin\theta_1\sin\theta_2+\cos\theta_1\cos\theta_2) \end{bmatrix}$

Now use the addition formulas for sine and cosine to see that this is equal to $\displaystyle \begin{bmatrix}\cos(\theta_1+\theta_2)&-\sin(\theta_1+\theta_2)\\ \sin(\theta_1+\theta_2)&\cos(\theta_1+\theta_2)\en d{bmatrix} = R(\theta_1+\theta_2)$.

3. Originally Posted by Opalg

Now use the addition formulas for sine and cosine to see that this is equal to $\displaystyle \begin{bmatrix}\cos(\theta_1+\theta_2)&-\sin(\theta_1+\theta_2)\\ \sin(\theta_1+\theta_2)&\cos(\theta_1+\theta_2)\en d{bmatrix} = R(\theta_1+\theta_2)$.
how did u get cos(theta1+theta2) from-sin(theta1)sin(theta2)+cos(theta1)cos(theta2)?

Shouldnt it be: -cos(theta1-theta2)?

and same for the one above that: -sin(theta1-theta2)?

4. Recall that the trigonometrical addition formulae are:

$\displaystyle \begin{array}{ccc} \sin{\left(\theta_1 + \theta_2 \right)} & = & \sin{\theta_1}\cos{\theta_2} + \sin{\theta_2}\cos{\theta_1} \\ \\ \sin{\left(\theta_1 - \theta_2 \right)} & = & \sin{\theta_1} \cos{\theta_2} - \sin{\theta_2} \cos{\theta_1} \end{array}$

$\displaystyle \begin{array}{ccc} \cos{\left(\theta_1 +\theta_2 \right)} & = & \cos{\theta_1} \cos{\theta_2} + \sin{\theta_1} \sin{\theta_2} \\ \\ \cos{\left( \theta_1 - \theta _2 \right)} & = & \cos{\theta_1} \cos{\theta_2} + \sin{\theta_1} \sin{\theta_2} \end{array}$

"Shouldnt it be: -cos(theta1-theta2)?

and same for the one above that: -sin(theta1-theta2)?"

So, $\displaystyle \begin{array}{ccc} - \cos{\left( \theta_1 - \theta_2 \right)} & = & - \left( \cos{\theta_1} \cos{\theta_2} + \sin{\theta_1} \sin{\theta_2} \right) \\ \; & \neq & - \sin{\theta_1} \sin{\theta_2} +\cos{\theta_1} \cos{\theta_2} \end{array}$

Hope that helps!

5. But how would you work it out? is it just to memorize?
The second column:
$\displaystyle {\color{white}R(\theta_1)R(\theta_2)} = \begin{bmatrix}(\cos\theta_1\cos\theta_2 -\sin\theta_1\sin\theta_2) &(-\cos\theta_1\sin\theta_2-\sin\theta_1\cos\theta_2)\\ (\sin\theta_1\cos\theta_2+\cos\theta_1\sin\theta_2 )& (-\sin\theta_1\sin\theta_2+\cos\theta_1\cos\theta_2) \end{bmatrix}$

Thats where am confused.

6. Originally Posted by taurus
But how would you work it out? is it just to memorize?
It would be very useful to memorise them; they seem to crop up all the time.

There is a nice proof using Euler's formula, if you've ever come across that. Investigate more here Trigonometric Addition Formulas -- from Wolfram MathWorld