I'm trying to get my head around a 3D rotation problem which I have simply not been able to solve for days.

Suppose I have a 3D space (x, y and z axes). I construct three vectors (x, y, z) which are simply unit vectors in each of the axis directions.

Suppose we now begin to rotate the 3 vectors taken other vectors in the system to be the axes of rotation. The first rotation is about the y axis by a degrees. This would give two new vectors (x', y, z').

Now we take this new group of three unit vectors and rotate them about the x' axis by b degrees, giving (x', y', z'').

Then my question is, what will be the new orientation of the z-axis? (ie. what would be the value of the unit vector z'')?

I'd appreciate a step-by-step explanation as I don't have an extensive level of mathematics experience and want to understand how this works.


Thanks to Matti P.'s comment I have looked through the page on Euler angles and Tait-Bryan angles and can see that this is where the solution lies, however, there are still some parts of the solution which I don't understand:

1) In my question, I am interested in performing two rotations (one about the x and the second about the y axis), not three as is shown in what I have read about Tait-Bryan angles. I am interested in getting the unit vector of the new z'' axis after the transformations.

2) I am still confused as to the formulas given in the article particularly with regards to the vectors. After each transformation, how can I get the unit vectors of the new intrinsic axes with reference to the original "environmental" axes?

  • $\begingroup$ en.wikipedia.org/wiki/Euler_angles $\endgroup$
    – Matti P.
    Commented Oct 15, 2019 at 8:39
  • $\begingroup$ Thanks for that, unfortunately the wikipedia page is very extensive in mathematical explanation and I find it a bit difficult to follow. Can you show me step-by-step how to get from the values of a and b which I defined in the question to the unit vector of z''? $\endgroup$
    – ose
    Commented Oct 15, 2019 at 8:47
  • $\begingroup$ If I understand correctly, what I am describing is an intrinsic Tait-Bryan rotation? $\endgroup$
    – ose
    Commented Oct 15, 2019 at 8:50

1 Answer 1


The most straightforward way of calculating rotations in 3D is by using Euler angles and matrix multiplication. I hope you are familiar with matrix multiplication.

Let's start by taking a vector $\vec{v}$ in 3 dimensions. This can be any vector of your choise. In the end, we will take $\vec{v} = z$-axis. Now, if we take any matrix $R$ whose determinant is $\det{R}=1$ and calculate $$ R\vec{v} $$ it turns out that this is some rotation of the original vector. It points to a new direction, and the length does not change.

The simplest rotation is a rotation about the $x$-axis, with an angle $\alpha$. Omitting the proof, it can be shown that the matrix $$ R_x(\alpha) = \left[ \begin{array}{ccc} 1 & 0 & 0 \\ 0 & \cos{\alpha} & -\sin{\alpha} \\ 0 & \sin{\alpha} & \cos{\alpha} \\ \end{array} \right] $$ can be used for this. Maybe you have seen something like this before? I suggest that you carry out some example calculations with some vectors of your choise. Do you see how the $x$-coordinate of the rotated vector doesn't change when you multiply them? Okay, good.

The other elementary rotation matrices are of course around the $y$ and $z$-axes. As a summary, all of the three elementary matrices are \begin{equation} R_X(x) = \left[ \begin{array}{ccc} 1 & 0 & 0 \\ 0 & \cos{x} & -\sin{x} \\ 0 & \sin{x} & \cos{x} \\ \end{array} \right] \qquad R_Y(x) = \left[ \begin{array}{ccc} \cos{x} & 0 & \sin{x} \\ 0 & 1 & 0 \\ -\sin{x} & 0 & \cos{x} \\ \end{array} \right] \qquad R_Z(x) = \left[ \begin{array}{ccc} \cos{x} & -\sin{x} & 0 \\ \sin{x} & \cos{x} & 0 \\ 0 & 0 & 1 \\ \end{array} \right] \end{equation}

These rotation matrices can then be combined. The most common Euler angle rotation order is the extrinsic $xyz$-order, which produces the (a bit complex-looking) \begin{equation} \begin{split} R &= R_Z(\psi) R_Y(\theta) R_X(\phi) \\ &= \left[ \begin{array}{ccc} \cos{\psi} & -\sin{\psi} & 0 \\ \sin{\psi} & \cos{\psi} & 0 \\ 0 & 0 & 1 \\ \end{array} \right] \left[ \begin{array}{ccc} \cos{\theta} & 0 & \sin{\theta} \\ 0 & 1 & 0 \\ -\sin{\theta} & 0 & \cos{\theta} \\ \end{array} \right] \left[ \begin{array}{ccc} 1 & 0 & 0 \\ 0 & \cos{\phi} & -\sin{\phi} \\ 0 & \sin{\phi} & \cos{\phi} \\ \end{array} \right] \\ &= \left[ \begin{array}{ccc} \cos{\theta}\cos{\psi} & \cos{\psi} \sin{\theta} \sin{\phi} - \cos{\phi} \sin{\psi} & \cos{\phi} \cos{\psi} \sin{\theta} + \sin{\phi} \sin{\psi} \\ % \cos{\theta}\sin{\psi} & \cos{\phi} \cos{\psi} + \sin{\theta} \sin{\phi} \sin{\psi} & \cos{\phi}\sin{\theta} \sin{\psi} - \cos{\psi} \sin{\phi} \\ % -\sin{\theta} & \cos{\theta}\sin{\phi} & \cos{\theta}\cos{\phi} \end{array} \right] \end{split} \end{equation}

This just means that the first rotation is carried out about the original $x$ axis (rotation by angle $\phi$), the second rotation is carried out about the original $y$-axis (angle $\theta$) and the last rotation is carried out about the original $z$-axis (angle $\psi$). The word "extrinsic" means that the axes by which the second and third rotation are carried out, do not change as a function of the previous rotations. So they are the "original" axes that remain fixed during the whole process.

The rotation order that you are requesting is an intrinsic $yxz$-rotation. Note that the previous calculations were only applied to the extrinsic rotation orders, which is the opposite of intrinsic. However, it can be shown that in order to calculate the intrinsic rotation, you only need to reverse the rotation order and then calculate the equivalent extrensic rotation. Proof for this is again omitted. So now we want to have the extrinsic $zxy$ rotation. This is merely a reordering of the previous example, resulting in \begin{equation} \begin{split} R &= R_Y(\theta) R_X(\phi) R_Z(\psi) \\ &= \left[ \begin{array}{ccc} \cos{\theta} & 0 & \sin{\theta} \\ 0 & 1 & 0 \\ -\sin{\theta} & 0 & \cos{\theta} \\ \end{array} \right] \left[ \begin{array}{ccc} 1 & 0 & 0 \\ 0 & \cos{\phi} & -\sin{\phi} \\ 0 & \sin{\phi} & \cos{\phi} \\ \end{array} \right] \left[ \begin{array}{ccc} \cos{\psi} & -\sin{\psi} & 0 \\ \sin{\psi} & \cos{\psi} & 0 \\ 0 & 0 & 1 \\ \end{array} \right] \\ &= \left[ \begin{array}{ccc} \cos{\theta}\cos{\psi} + \sin{\theta}\sin{\phi}\sin{\psi} & - \cos{\theta}\sin{\psi}+\cos{\psi}\sin{\theta}\sin{\psi} & \cos{\phi}\sin{\theta} \\ \cos{\phi}\sin{\psi} & \cos{\phi}\cos{\psi} & - \sin{\phi}\\ -\cos{\psi}\sin{\theta} + \cos{\theta}\sin{\phi}\sin{\psi} & \sin{\theta}\sin{\psi} + \cos{\theta}\cos{\psi}\sin{\phi} & \cos{\theta}\cos{\phi} \end{array} \right] \end{split} \end{equation} (I recommend you double-check this calculation, because it's very easy to make a mistake in the multiplication). In your case, $\psi=0$, simplifying the result a bit: $$ R = \left[ \begin{array}{ccc} \cos{\theta} & \sin{\theta}\sin{\phi} & \cos{\phi}\sin{\theta} \\ 0 & \cos{\phi} & - \sin{\phi} \\ -\sin{\theta} & \cos{\theta}\sin{\phi} & \cos{\theta}\cos{\phi} \end{array} \right] $$ You were asking about the new components of the $z$-axis, in particular, so we must multiply this with the corresponding vector: $$ R \vec{z} = \left[ \begin{array}{ccc} \cos{\theta} & \sin{\theta}\sin{\phi} & \cos{\phi}\sin{\theta} \\ 0 & \cos{\phi} & - \sin{\phi} \\ -\sin{\theta} & \cos{\theta}\sin{\phi} & \cos{\theta}\cos{\phi} \end{array} \right] \left( \begin{array}{c} 0 \\ 0 \\ 1 \end{array} \right) = \left( \begin{array}{c} -\sin{\theta} \\ \cos{\theta}\sin{\phi} \\ \cos{\theta}\cos{\phi} \end{array} \right) $$ Huh, quite a calculation! So just plug in $\theta=a$ and $\phi=b$ to get the result.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .