ME 482/582 Chapter 2 HW Solution: U A B C T T T U
ME 482/582 Chapter 2 HW Solution: U A B C T T T U
2.1 These are both rotations relative to the “reference” frame, so we premultiply:
cθ −sθ 0
R = RX (φ)RZ (θ)I = cφsθ cφcθ −sφ (1)
sφsθ sφcθ cφ
The I (identity) matrix in (1) represents the original orientation of frame {B}; I inserted that just to clarify the fact
that we’re premultiplying here.
Note that when you operate on a vector you have to premultiply—the dimensions are incompatible if you try to
postmultiply. And that makes sense—postmultiplication represents operations along/around the moving frame axes,
and with just a vector there’s no frame. So the only option is to transform the vector along/around the reference
frame axes, which implies premultiplication.
2.3 The mapping matrix that changes the relativity is the same as the descriptor matrix, which can be also thought
of as the operator matrix that “produces” the new frame. Here the rotations are “body” or “moving” frame rotations,
hence we should postmultiply:
cθ −sθcφ sθsφ
R = IRZ (θ)RX (φ) = sθ cθcφ −cθsφ (2)
0 sφ cφ
Again, I inserted the I matrix to represent the initial orientation of frame {B} to clearly show the postmultiplication.
Note that since the two frames are initially coincident, the first multiplication could be pre- or post-, it wouldn’t
matter.
2.5 The eigenvalue problem with matrix A, eigenvector x, and eigenvalue λ can then be stated as: Ax = λx. Here
we have
A
B RV = λV (3)
For the eigenvector λ = 1 the vector V is unchanged by the rotation. The only vector that is always unchanged by a
rotation is the axis of rotation. Hence if you have an arbitrary R matrix—find the eigenvector corresponding to the
eigenvalue λ = 1 and you will have the axis of rotation!
2.12 Velocity vectors are free vectors, and must never be operated on by a 4 × 4 T transformation matrix—only by a
3 × 3 R matrix. Extract the A A
B R partition from the given B T matrix and use that. My result—which I obtained using
MATLAB—is:
−1.3400
A
V= A B
BR V =
22.3200 (4)
30.0000
U A B C U
U B B C
AT AT CT UT
1
ME 482/582 Chapter 2 HW September 7, 2011
From this transform diagram, going from B to C the “long” way yields the desired result is
0.5000 0.7500 0.4330 −6.5754
B B U −1 C −1
−0.7500 0.6250 −0.2165 19.7877
C T = AT AT UT = (5)
−0.4330 −0.2165 0.8750 −28.3185
0 0 0 1.0000
2.18 Consider a frame {B} initially coincident with frame {A}. To describe a point using spherical coordinates one
must perform the following three operations (remember that a descriptor is the same as the operator sequence that
produces the result):
Since all operations are performed around/along the rotated frame, we postmultiply, and the operator sequence that
will accomplish the description of this point in spherical coordinates is
Psph = RZ (α)RY (−β)DX (r) (6)
cα −sα 0 0 cβ 0 −sβ 0 1 0 0 r ∗ ∗ ∗ rcαcβ
sα cα 0 0 0 1 0 0 0 1 0 0 ∗ ∗ ∗ rsαcβ
= = (7)
0 0 1 0 sβ 0 cβ 0 0 0 1 0 ∗ ∗ ∗ rsβ
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1
Since we really want the position of the transformed frame’s origin, extract the 4th column (first three components)
from (7), so we have
r cos α cos β
A
P = r sin α cos β (8)
r sin β
2.28 I think the geometry is simple enough to find the frame by inspection; you don’t need to use any rota-
tion/translation operations (or involve frame {B}. The transform A
C T I found this way was
0 −0.5 0.866 3 r11 r12 r13 x
A
0 0.866 0.5 0 r21 r22 r23 y
C T = −1
= (9)
0 0 2 r31 r32 r33 z
0 0 0 1 0 0 0 1
Using text equations (2.74), we find that the Z-Y-Z Euler angles which correspond to this rotation matrix are
The angles in parentheses are the result if you use the “-” sign for the square root term in the expression for angle β.
The “parenthesized” results are correct but are not minimal rotations.
2.38 If two vectors V1 and V2 are fixed in the same body, the angle α between them is constant. This angle can be
found from the dot product, hence
V1 · V2 = V1T V2 = cos α (13)
2
ME 482/582 Chapter 2 HW September 7, 2011
Next operate on each of these vectors by a rotation operator R and compute their dot product, where the result must
be the same:
T
(RV1 ) (RV2 ) = V1T V2 (14)
T
Finally, use the property of the matrix transpose (AB) = BT AT :
which shows that rotation matrix R has transpose equal to inverse (since RT = R−1 .
Since the expression RT R represents the dot products of all the columns of R, this also shows that a rotation matrix
is orthonormal (the “normal” part means its columns have a norm of one) since RT R = I, the identity matrix.
Programming Exercises. When I write programs, I like to insert lots of comments and make everything as easy to
follow as possible. My two functions are:
------------------------------------------------------------------------------------------
c_theta = iform(1,1);
s_theta = iform(2,1);
3
ME 482/582 Chapter 2 HW September 7, 2011
When I used these functions (along with the MATLAB matrix inverse and multiply) in my “main program” chpt2.m,
I got the following results for the “internal” and “user” forms of B
C T:
>> chpt2
Final internal form:
T_CBi =
T_CBu =
-10.8840
9.3616
45.0000
The MATLAB code for files utoi.m and itou.m will be on my website after the homework is due.
function R = euler2R(e)
% R = euler2R(e)
%
% MATLAB function to satisy MATLAB Exercise 2A, part (a); convert Z-Y-Z
% Euler angles to the corresponding 3x3 rotation matrix R. Vector e should
% contain the three angles (deg) as either a row or column vector.
% Define the needed trig functions of the angles for clarity and efficienty
ca = cos(e(1)*RAD);
sa = sin(e(1)*RAD);
cb = cos(e(2)*RAD);
sb = sin(e(2)*RAD);
cg = cos(e(3)*RAD);
sg = sin(e(3)*RAD);
4
ME 482/582 Chapter 2 HW September 7, 2011
ans = -2.7756e-17, ans = 0, ans = 0 % All three dot products are 0, so 3 more constraints
Therefore given 9 elements in R, and 6 constraints, there are only 3 resulting independent quantities.
(ii) For the second example,
The same tests can be carried on these results as in example (i)—they all work.
5
ME 482/582 Chapter 2 HW September 7, 2011
e1 = [a1 b1 g1]*DEG;
e2 = [a2 b2 g2]*DEG;
To demonstrate the function, I’ll show part (ii) only—part (i) works also.
(c) Starting with coincident frames {A} and {B}, rotating frame {B} by β = 20◦ (Y axis only), we have for A
B R:
>> R = euler2R(e)
R = 0.9397 0 0.3420
0 1.0000 0
-0.3420 0 0.9397
B
T
Given vector P= 1 0 1 , to express this vector in frame {A} we have
Pa = 1.2817
0
0.5977
A sketch is shown below. Note that axis Y is directed into the page.
ZA ZB
P
0.597
XA
1.28
XB