Notebook for 02 Feb 12

Let’s prove once and for all that Det(AB)=Det(A)Det(B):

$Post= MatrixForm
mat1 = {{a1,b1},{c1,d1}}
mat2 = {{a2,b2},{c2,d2}}

proposition =Det[mat1.mat2]==Det[mat1]*Det[mat2]

Simplify[proposition]

Turns out there is this function:

?RotationMatrix

With one argument you get a 2x2 matrix:

RotationMatrix[10 Degree]

which obeys properties such as you showed in hwk:

RotationMatrix[10 Degree].RotationMatrix[20 Degree]//Simplify

When called with an angle and direction vector, here is what get:

RotationMatrix[θ,{0,0,1}]

Your task: try different direction vectors.

$Post=.

Here is how to make a list of random points with x and y coordinates in the interval (0,1)

points = Table[{Random[],Random[]},{10}]

ListPlot[points,PlotRange->{{-1,1},{-1,1}},AspectRatio->1]

And here we make a knob α which controls the amount of rotation:

Manipulate[ListPlot[(RotationMatrix[α].#&/@points),PlotRange->{{-1,1},{-1,1}},AspectRatio->1],{α,0,2π}]

Now repeat in full 3 dimensions, now letting coordinates be negative too:

pts3D = Table[Table[Random[Real,{-1,1}],{3}],{10}]

To plot, it is ListPointPlot3D:

ListPointPlot3D[pts3D,PlotRange->{{-1,1},{-1,1},{-1,1}},AspectRatio->1]

Start by rotating about the Z-axis:

Manipulate[ListPointPlot3D[(RotationMatrix[α,{0,0,1}].#&/@pts3D),PlotRange->{{-1,1},{-1,1},{-1,1}},AspectRatio->1],{α,0,4π}]

And then try a rotation axis which slants between x and z:

Manipulate[ListPointPlot3D[(RotationMatrix[α,{1,0,1}].#&/@pts3D),PlotRange->{{-1,1},{-1,1},{-1,1}},AspectRatio->1],{α,0,4π}]

To visualize, it helps to plot an orbit or two

orbit2=ParametricPlot3D[RotationMatrix[α,{1,0,1}].pts3D[[2]],{α,0,2π}]

orbit4=ParametricPlot3D[RotationMatrix[α,{1,0,1}].pts3D[[4]],{α,0,2π}]

Manipulate[Show[ListPointPlot3D[(RotationMatrix[α,{1,0,1}].#&/@pts3D),PlotRange->{{-1,1},{-1,1},{-1,1}},AspectRatio->1],orbit2,orbit4],{α,0,4π}]

Here are some 3D graphics primitives which we can use to build up an animation of a gyroscope:

?Cylinder
?Line

Define a box to be the playing field which will define the field of view as the disk spins:

box=Plot3D[-2,{x,-2,2},{y,-2,2},PlotRange->{{-2,2},{-2,2},{-2,2}},AspectRatio->1]

Here is the disk (i.e. a short cylinder) at t=0, with some lines drawn for reference:

disk0=Graphics3D[{Cylinder[{{1,0,0},{1.04,0,0}}],Line[{{1,0,0},{1,1,0},{1.04,1,0},{1.04,0,0}}],Thick,Green,Line[{{0,0,0},{1,0,0}}]}]

Here is how to put them together:

Show[box,disk0]

Next we want to spin, so we'll use this function on graphics objects:

?Rotate

Define a rotated disk, first doing the "spin" about the x-axis (leaving the CM in place), then "orbiting" about the z-axis

disk[θ_,ϕ_] := Rotate[Rotate[{Cylinder[{{1,0,0},{1.04,0,0}}],Line[{{1,0,0},{1,1,0},{1.04,1,0},{1.04,0,0}}],Thick,Green,Line[{{0,0,0},{1,0,0}}]},θ,{1,0,0}],ϕ,{0,0,1}]

And here is a drawing function, where we now include a dot for our pivot point at the center:

draw[θ_,ϕ_]:=Show[box,Graphics3D[disk[θ,ϕ]],Graphics3D[{PointSize[Large],Red,Point[{0,0,0}]}],ViewPoint->{2,1,1}]

Choosing parameters we animate:

Ω=1;ω=20;

Animate[draw[ω t,Ω t],{t,0,2π}]

To track an individual piece of the disk we draw a parametric plot:

pt0={1,0,.5}

pt[t_] = RotationMatrix[Ω t,{0,0,1}].RotationMatrix[ω t,{1,0,0}].pt0

curve=ParametricPlot3D[pt[t],{t,0,2π}]

OK let's add the point to the disk object:

disk[θ_,ϕ_] := Rotate[Rotate[{Cylinder[{{1,0,0},{1.04,0,0}}],Line[{{1,0,0},{1,1,0},{1.04,1,0},{1.04,0,0}}],Thick,Green,Line[{{0,0,0},{1,0,0}}],{PointSize[Large],Blue,Point[pt0]}},θ,{1,0,0}],ϕ,{0,0,1}]

And lastly, redefine "draw" to include the curve too:

draw[θ_,ϕ_]:=Show[box,curve,Graphics3D[disk[θ,ϕ]],Graphics3D[{PointSize[Large],Red,Point[{0,0,0}]}],ViewPoint->{2,1,1}]