Biomedical Engineering Reference
In-Depth Information
% and equations 4.27-29 as matrix C
C
¼
[ cos(z), sin(z), 0;
-sin(z), cos(z), 0;
0,
0,
1]
% The matrix equation 4.30 is created by multiplying matrices C, B
% and A
D
¼
C*B*A
The resulting transformation matrix from the preceding m-file is
D
¼
[cos(z)*cos(y)
þ
sin(z)*sin(x)*sin(y), sin(z)*cos(x), -cos(z)
*sin(y)
sin(z)*sin(x)*cos(y)]
[-sin(z)*cos(y)
þ
þ
cos(z)*sin(x)*sin(y), cos(z)*cos(x), sin(z)
þ
*sin(y)
cos(z)*sin(x)*cos(y)]
[cos(x)*sin(y),
-sin(x),
cos(x)*cos(y)]
which is the same as Eq. (4.31).
The Euler transformation matrices are used differently depending on the available data. For
example, if the body coordinates in both the fixed (unprimed) and body (triple primed) systems
are known, the body angles y x , y y , and y z can be computed, for example, using Eqs. (4.32)-(4.34)
for a
rotation sequence. Alternatively, the body's initial position and the angles y x , y y , and
y z may be used to compute the body's final position.
y
-
x
-
z
EXAMPLE PROBLEM 4.4
An aircraft undergoes 30 degrees of pitch (y x ), then 20 degrees of roll (y y ), and finally 10 degrees
of yaw (y z ). Write a MATLAB function that computes the Euler angle transformation matrix for
this series of angular rotations.
Solution
Since computers use radians for trigonometric calculations, first write two simple functions to
compute cosines and sines in degrees:
¼
function y
cosd(x)
%COSD(X) cosines of the elements of X measured in degrees.
y
¼
cos(pi*x/180);
¼
function y
sind(x)
%SIND(X) sines of the elements of X measured in degrees.
y
¼
sin(pi*x/180);
Next write the
x
-
y
-
z
rotation sequence transformation matrix:
¼
function D
eulangle(thetax, thetay, thetaz)
%EULANGLE matrix of rotations by Euler's angles.
% EULANGLE(thetax, thetay, thetaz) yields the matrix of
Continued
Search WWH ::




Custom Search