Content deleted Content added
small estetic fixes |
spelling, made cos into \cos. Other minor fixes. |
||
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
A unit quaternion can be described as:
Line 7 ⟶ 6:
:<math>|\mathbf{q}|^2 = q_0^2 + q_1^2 + q_2^2 + q_3^2 = 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
Line 24 ⟶ 22:
The [[orthogonal matrix]] corresponding to a rotation with Euler angles <math>\phi, \theta \, and\, \psi</math>, is given by
:<math>\begin{bmatrix}
\cos\theta \cos\psi & -\cos\phi \sin\psi + \sin\phi \sin\theta \cos\psi & \sin\phi \sin\psi + \cos\phi \sin\theta \cos\psi \\
\cos\theta \sin\psi & \cos\phi \cos\psi + \cos\phi \sin\theta \sin\psi & -\sin\phi \cos\psi + \cos\phi \sin\theta \sin\psi \\
-\sin\theta & \sin\phi \cos\theta & \cos\phi \cos\theta \\
\end{bmatrix}</math>
== Conversion ==
By comparing the
:<math> \mathbf{q} = \begin{bmatrix}
\cos_2 \phi \cos_2 \theta \cos_2 \psi + \sin_2 \phi \sin_2 \theta \sin_2 \psi \\
\sin_2 \phi \cos_2 \theta \cos_2 \psi + \cos_2 \phi \sin_2 \theta \sin_2 \psi \\
\cos_2 \phi \sin_2 \theta \cos_2 \psi + \sin_2 \phi \cos_2 \theta \sin_2 \psi \\
\cos_2 \phi \cos_2 \theta \sin_2 \psi + \sin_2 \phi \sin_2 \theta \cos_2 \psi \\
\end{bmatrix}</math>
where <math>\cos_2 \alpha</math> is a notational shortcut for <math>\cos \frac{\alpha}{2}</math>, and <math>\sin_2 \alpha</math> for <math>\sin \frac{\alpha}{2}</math>. And for Euler angles we get:▼
▲where <math>cos_2 \alpha</math> is a notational shortcut for <math>cos \frac{\alpha}{2}</math>, and <math>sin_2 \alpha</math> for <math>sin \frac{\alpha}{2}</math>. And for Euler angles we get:
:<math>\begin{bmatrix}
Line 46 ⟶ 43:
\end{bmatrix} =
\begin{bmatrix}
\mbox{atan} \frac {2(e_0 e_1 + e_2 e_3)} {1 - 2(e_1^2 + e_2^2)} \\
\mbox{asin} (2(e_0 e_2 - e_3 e_1)) \\
\mbox{atan} \frac {2(e_0 e_3 + e_1 e_2)} {1 - 2( e_2^2 + e_3^2)}
\end{bmatrix} </math>
One must be aware of singularities in the Euler angle parametrizartion when the pitch approaches <math>\pm 90^o</math> (north/south pole). These cases must be handled specially.
{{
[[Category:Abstract algebra]]
[[Category:Computer graphics]]
|