Multiplying Rotation Matrices

201 Views Asked by At

Let's say I have 2 Euler angles as vectors, A=[96.708, 33.581, 52.147] and B=[45, 15, 30].

If I add these vectors together I get the Euler angle C=[141.708, 48.581, 82.147].

When converting A and B to Quaternions in YXZ order I get:

Q_A=\begin{bmatrix}w=0.666328498, x=0.726973335, y=-0.142010576, z=0.085726883\end{bmatrix} and Q_B=\begin{bmatrix}w=0.897692569, x=0.397692569, y=0.018283046, z=0.188823735\end{bmatrix} such that:

Q_A * Q_B = \begin{bmatrix}w=0.295455364, x=0.889210137, y=-0.218476201, z=0.272542859\end{bmatrix}

This makes a 3x3 matrix:

\begin{bmatrix} 0.755977079 &-0.549591004 & 0.355595816 \\ -0.227494005 & -0.729948556 & -0.644532066 \\ 0.613795677 & 0.406355552 & -0.676853036 \end{bmatrix}

However, it's different from the YXZ matrix and quaternion produced by the addition of the two vectors described above that become C=[141.708, 48.581, 82.147]:

\begin{bmatrix} 0.550717454 & -0.591865547 & -0.588562197 \\ -0.777502359 & -0.107237372 & -0.61966945 \\ 0.303645135 & 0.798871279 & -0.519234352 \end{bmatrix}

Q_C = \begin{bmatrix}w=0.480688498, x=0.737765067, y=-0.464025734, z=-0.096547355\end{bmatrix}

What do I need to multiply Q_A * Q_B by in order to get Q_C if I were storing and working with only quaternions and not Euler angles?