1
$\begingroup$

I have a very simple problem, that I cannot wrap my head around and is hurting my brain. I have a very simple example of the problem, please consider the the figure below:

1) Starting position, 2) after first rotation, 3) after second rotation

In the first picture, you see a right handed reference frame, with a body defined in it and a point P on that body. What I want to do is calculate the position of this point P after two consecutive rotations, in the initial reference frame, sounds simple right? :) :

1)Let's assume $P=\begin{bmatrix}-1 & 4 & 0\end{bmatrix}^T$ and we start with a negative rotation (-45 degrees)around the Y-axis, yielding the rotation matrix $$R_y(-0.5\pi)=\begin{bmatrix}\cos(\theta) & 0 & \sin(\theta)\\ 0 & 1 & 0\\ -\sin(\theta) & 0 & \cos(\theta) \end{bmatrix}=\begin{bmatrix}0.707 & 0 & -0.707\\ 0 & 1 & 0\\ 0.707 & 0 & 0.707 \end{bmatrix}$$ Multiplying gives $$R_yP=\begin{bmatrix}-0.707 \\ 4 \\-0.707\end{bmatrix} $$ So far, so good, as can be seen in part 2 of the figure. Where these are indeed the coordinates of the point in the reference frame of figure 1.

2) Apply a 180 degree rotation around the $Z'$ axis $$R_z({\pi})=\begin{bmatrix}\cos(\theta) & -\sin(\theta) & 0\\ \sin(\theta) &\cos(\theta)& 0\\ 0& 0 &1\end{bmatrix}=\begin{bmatrix}-1 & 0 & 0\\ 0 &-1& 0\\ 0& 0 &1\end{bmatrix}$$ Multiplying again gives $$R_zR_yP=\begin{bmatrix} 0.707 \\-4 \\-0.707\end{bmatrix}$$

Which is exactly where my problem lies, since this answer is wrong. The z-component should be positive as can be seen in part 3 of the figure (In the original reference frame!). I see that $R_z$ can never cause a sign change on the z-component, but I don't see where I go wrong.

I have been reading all I could find on active and passive rotation, space fixed vs body fixed rotations, but I can't seem to figure out where I assume something wrong. I'm performing an active rotation, so I believe I take the correct definitions of the rotation matrices, nor does transposing them solve the problem. I'm also applying a body-fixed rotation, hence using the pre multiplication is correct, even though switching the order of multiplication around does give me the correct answer.

Can somebody explain to me where in my assumptions I am going wrong? It seems so simple, but I can't seem to pinpoint where my error is and I will probably facepalm myself from stupidity :) Thanks a bunch!

$\endgroup$
2
$\begingroup$

The points seem correct, but the drawings are a bit off from the text.

Rotation matrises rotate the point along the axis they operate. That means that rotation matrix y $R_y$ does not change the y-coordinate. Also, rotation matrix z $R_z$ does not change the z-coordinate.

In the drawings you are rotating the axis and the blue box. You should rotate on one of those. The mistake is between 2 and 3 as the axes are pointing in wrong direction respect to the box. Keep the axis the same, like in fig 1, and when rotating the box the second time use the z-axis of fig 1.

In this version of the drawing you are rotating a point that is always in x-y plane. The point in second figure seems to be (-1,4,0) not (-0.707, -4, -0.707) as you say in the text.

$\endgroup$
  • $\begingroup$ Hi, thanks for your comments. You are right about the fact that the axes should not be rotating. I drew them to make it more clear what the rotation was. The axes in the 2nd and 3rd figure are indeed attached to the body. Also the (-0.707, -4, -0.707) coordinates are again in the frame of the first figure. $\endgroup$ – YugT Jan 26 '15 at 22:41
  • $\begingroup$ One more comment. If I would rotate the second time around the Z-axis of figure 1, the outcome of the rotation will be different I believe. $\endgroup$ – YugT Jan 26 '15 at 22:47
  • $\begingroup$ @YugT yes the outcome of the rotation will be different in the figures and then it matches the calculation. That is the essential thing here. Do not change the axis what you use for rotation. Now, the rotation between figures 2 and 3 is $R_z (-1, 4,0)$. You want $R_z (-0.707, 4, -0.707)$. (Alternatively you can drop the $R_y$ in the bullet 2 in the text). $\endgroup$ – Juha Jan 26 '15 at 23:42
  • $\begingroup$ In other words, the second rotation $R_z R_y P$ is a rotation respect to $Z$, not $Z'$ $\endgroup$ – Juha Jan 26 '15 at 23:44
  • $\begingroup$ That's right. The formula used in the question is for rotation about Z, not Z'. $\endgroup$ – Floris Jan 27 '15 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.