%% B1 to G
a = degtorad(20);
b = degtorad(35);
c = degtorad(-40);
eul = [a b c];
rotm_B1_G = eul2rotm(eul)
%% B2 to G
a = degtorad(60);
b = degtorad(-30);
c = degtorad(-10);
eul = [a b c];
rotm_B2_G = eul2rotm(eul)
rotm_B2_B1 = rotm_B1_G'*rotm_B2_G
%% Unit Vector
UVx = rotm_B2_B1(3,2) - rotm_B2_B1(2,3);
UVy = rotm_B2_B1(1,3) - rotm_B2_B1(3,1);
UVz = rotm_B2_B1(2,1) - rotm_B2_B1(1,2);
UV = [UVx UVy UVz]'
UV =
0.5869
-1.8527
0.2964
Trace_rotm_B2_B1 = rotm_B2_B1(1,1) + rotm_B2_B1(2,2) + rotm_B2_B1(3,3)
X = (Trace_rotm_B2_B1 -1)\2
theta = acos(X)
theta =
0.0000 + 2.3779i
6. Euler Angles between Two Local Frames The Euler angles between the coordinate frame Bi and G are 20deg. 35 deg, and -40deg. The Euler angles between the coordinate frame B2 and G are 60 deg. -30de...