Question 11.23: For the yaw–pitch–roll sequence ϕyaw = 50°, θpitch = 90°, an...
For the yaw–pitch–roll sequence \phi_{\text {yaw }} = 50°, \theta_{\text {pitch }} = 90°, and \psi_{\text {roll }} = 120°, calculate
(a) the quaternion and
(b) the rotation angle and the axis of rotation.
Learn more on how do we answer questions.
(a) Substituting the given angles into Eq. (11.119) yields the direction cosine matrix
[ Q ]_{X x}=\left[\begin{array}{ccc}0 & 0 & -1 \\0.93969 & 0.34202 & 0 \\0.34202 & -0.93969 & 0\end{array}\right] (a)
[Q]_{X x}=\left[\begin{array}{ccc}\cos \phi \cos \theta & \sin \phi \cos \theta & -\sin \theta \\\cos \phi \sin \theta \sin \psi-\sin \phi \cos \psi & \sin \phi \sin \theta \sin \psi+\cos \phi \cos \psi & \cos \theta \sin \psi \\\cos \phi \sin \theta \cos \psi+\sin \phi \sin \psi & \sin \phi \sin \theta \cos \psi-\cos \phi \sin \psi & \cos \theta \cos \psi\end{array}\right] (11.119)
Substituting the components of [Q]_{X x} into Eq. (11.159), we get
[ K ]=\left[\begin{array}{rrrr}-0.11401 & 0.31323 & -0.21933 & 0.31323 \\0.31323 & 0.11401 & -0.31323 & 0.44734 \\-0.21933 & -0.31323 & -0.11401 & -0.31323 \\0.31323 & 0.44734 & -0.31323 & 0.11401\end{array}\right]
[ K ]=\frac{1}{3}\left[\begin{array}{cccc}Q_{11}-Q_{22}-Q_{33} & Q_{21}+Q_{12} & Q_{31}+Q_{13} & Q_{23}-Q_{32} \\Q_{21}+Q_{12} & -Q_{11}+Q_{22}-Q_{33} & Q_{32}+Q_{23} & Q_{31}-Q_{13} \\Q_{31}+Q_{13} & Q_{32}+Q_{23} & -Q_{11}-Q_{22}+Q_{33} & Q_{12}-Q_{21} \\Q_{23}-Q_{32} & Q_{31}-Q_{13} & Q_{12}-Q_{21} & Q_{11}+Q_{22}+Q_{33}\end{array}\right] (11.159)
The following is a MATLAB script that implements the power method described in Algorithm 11.2.
The quaternion is the eigenvector associated with \lambda_{\max }, so that
\widehat{ q }=\left\{\begin{array}{r}0.40558 \\0.57923 \\-0.40558 \\\hdashline 0.57923\end{array}\right\}
Observe that \|\widehat{ q }\|=1 . \widehat{ q } must be a unit quaternion.
(b) From Eq. (11.146), we find that the principal angle is
\theta=2 \cos ^{-1}\left(q_4\right)=2 \cos ^{-1}(0.57923)=54.604^{\circ}
\widehat{ p } \otimes \widehat{ q }=\left\{\frac{p_4 q +q_4 p + p \times q }{p_4 q_4- p \cdot q }\right\} (11.146)
and the Euler axis is
\hat{ u }=\frac{0.40558 \hat{ I }+0.57923 \hat{ J }-0.40558 \hat{ K }}{\sin \left(54.604^{\circ} / 2\right)}=0.4975 \hat{ I }+0.71056 \hat{ J }-0.49754 \hat{ K }
K = [-0.11401 0.31323 -0.21933 0.31323
0.31323 0.11401 -0.31323 0.44734
-0.21933 -0.31323 -0.11401 -0.31323
0.31323 0.44734 -0.31323 0.11401];
v0 = [1 1 1 1]0; %Initial estimate of the eigenvector.
v0 = v0/norm(v0); %Normalize it.
lamda_new = v00*K*v0; %Rayleigh quotient (norm(v0) = 1)
% estimate of the eigenvalue.
lamda_old = 10*lamda_new; %Just to begin the iteration.
no_iterations = 0; %Count the number of iterations.
tolerance = 1.e-10;
while abs((lamda_new - lamda_old)/lamda_old) > tolerance
no_iterations = no_iterations + 1;
lamda_old = lamda_new;
v = v0;
vnew = K*v/norm(K*v);
lamda_new = vnew0*K*vnew; %Rayleigh quotient (norm(vnew) = 1).
v0 = vnew;
end
no_iterations = no_iterations
disp(‘ ‘)
lamda_max = lamda_new
eigenvector = vnew
The output of this program to the Command Window is as follows:
no_iterations =
12
lamda_max =
1
eigenvector =
0.40558
0.57923
-0.40558
0.57923