Conversion between quaternions and Euler angles: Difference between revisions

Content deleted Content added
initial stub
 
initial stub
Line 1:
Spatial rotations in three dimensions can be parametrized using both [[Euler angles]] and [[Quaternions and spatial rotation|unit quaternions]]. This article explains how to convert betweeen the two representatios.
 
 
A unit quaternion can be described as:
:<math>\mathbf{q} = \begin{bmatrix} q_0 & q_1 & q_2 & q_3 \end{bmatrix}^T</math>
where
:<math>|\mathbf{q}|^2 = q_0^2 + q_1^2 + q_2^2 + q_3 = 1</math>
 
 
Simmilarly for Euler angles, we use:
* Roll - <math>\phi</math>: rotation about the X-axis
* Pitch - <math>\theta</math>: rotation about the Y-axis
* Yaw - <math>\psi</math>: rotation the Z-axis
where the X-axis points forward, Y-axis to the right and Z-axis downward
 
== Rotation matrices ==
The [[orthogonal matrix]] corresponding to a rotation by the unit quaternion ''z'' = ''a'' + ''bi'' + ''cj'' + ''dk'' (with |z| = 1) is given by
:<math>\begin{bmatrix}
Line 12 ⟶ 28:
-sin\theta & sin\phi cos\theta & cos\phi cos\theta \\
\end{bmatrix}</math>
 
== Conversion ==
By comparing the tems in the two matrices, we get....