Animated gifs from Maple, using rotation matrices for the euler angles.
(Note: The viewing direction is different in the two animations.)
a) Which Euler angles are changing in the lefthand animation?
b) Which Euler angles are changing in the righthand animation?
Show the effect of a rotation matrix on a vector as a function of time. In particular, implement the euler angle rotations and animate them.
Viewing is done along a polar (Pol) and azimuthal (Az) angle.
Initial angles theta, phi, and psi are specified, and rotation rates for all 3.
The calculation starts from body x3,y3,z3 components, and works backward to the space xyz coordinates. When x,y,z are known for each body axis, a projection is done into the viewing direction, and an animation is made.
Forward rotation thru angle a gives xnew = xold cos(a) + yold sin(a), etc.
MAPLE COMMANDS ARE IN BOLDFACE.
Rotation matrix m1 is forward rotation thru angle x.
x'= m1 * x .
Ditto for m2 and m3
We start with body axes in their fully rotated x3,y3,z3 system. (The body x axis is (1,0,0) in this system.) To get to components of the rotated body axes in the original space x,y,z system we must do a reverse rotation thru -psi, then reverse thru -theta, then reverse thru -phi. This will lead us to the xyz components of the body's axes after the body has been rotated in space
r123:=evalm(r1 &* r2 &* r3);
To represent the body x-axis, we will later set (f1, f2, ,f3) to (1,0,0), then to (0,1,0) for body y axis, etc.
v represents the x,y,z components of (f1,f2,f3) after it has been rotated through the three Euler angles.
v:=evalm(r123 &* v1);
But we will be viewing the rotated vector v along a particular direction in space.
The pL vector below gives the projection of a vector in x,y,z in the plane perpendicular to a viewing direction specified by polar and azimuthal angles Pol, and Az.
This projection is necessary to get relatively rapid animation. A full 3d animation in Maple is very time consuming.
p0 represents the point at the origin of coordinates.
Now set up the view of lines which have been rotated
for i from 0 to Nframes do