How to rotate a matrix using quaternion?

656 Views Asked by At

Given the constant coefficient matrix $M_{3 \times 3}$, and a rotation matrix $R_{3 \times 3}$ with respect to the inertial frame. How to use unit quaternion $q=[q0,q1,q2,q3]^{T}$ to represent the rotation matrix R for the term $MR^{T}$?

1

There are 1 best solutions below

3
On

I hope that I understand the question correctly.

Assuming that $q = [q_0, q_1, q_2, q_3]$ is a unit quaternion, it corresponds to rotation matrix $R$, given by

$$ R = \left[\begin{matrix} 1 - 2 (q_2^2+q_3^2) & 2(q_1q_2 - q_3q_0) & 2(q_1q_3+q_2q_0) \\ 2(q_1q_2 + q_3q_0) & 1 - 2(q_1^2+q_3^2) & 2(q_2q_3-q_1q_0) \\ 2(q_1q_3 + q_2q_0) & 2(q_2q_3+q_1q_0) & 1 - 2(q_1^2+q_2^2), \end{matrix}\right]. $$