Euler Angles

PlotEulerAngles[phi_,theta_,psi_,label_,convention_]:=Module[{xi,eta,zeta,xiprime,etaprime,zetaprime,xprime,yprime,zprime,etheta,epsi,phiarc,thetaarc,psiarc},
(* Start with z rotation *)
xi = RotationMatrix[phi,{0,0,1}].{1,0,0};
eta = RotationMatrix[phi,{0,0,1}].{0,1,0};
zeta = RotationMatrix[phi,{0,0,1}].{0,0,1};

If[convention=="x",
xiprime =RotationMatrix[theta,xi].xi;
etaprime =RotationMatrix[theta,xi].eta;
zetaprime =RotationMatrix[theta,xi].zeta;
etheta = RotationMatrix[theta/2,xi].zeta;
epsi = RotationMatrix[psi/2,zetaprime].xiprime,


(* else the convention == "y" *)
xiprime =RotationMatrix[theta,eta].xi;
etaprime =RotationMatrix[theta,eta].eta;
zetaprime =RotationMatrix[theta,eta].zeta;
etheta = RotationMatrix[theta/2,eta].zeta;
epsi = RotationMatrix[psi/2,zetaprime].etaprime;
];

xprime = RotationMatrix[psi,zetaprime].xiprime;
yprime = RotationMatrix[psi,zetaprime].etaprime;
zprime = RotationMatrix[psi,zetaprime].zetaprime;


phiarc = Table[0.7RotationMatrix[tx,{0,0,1}].{1,0,0},{tx,0,Max[phi,0.01],0.05}];

If[convention=="x",
thetaarc = Table[0.7RotationMatrix[tx,xi].zeta,{tx,0,Max[theta,0.01],0.05}];psiarc = Table[0.7RotationMatrix[tx,zetaprime].xiprime,{tx,0,Max[psi,0.01],0.05}],

(* else the convention == "y" *)
thetaarc = Table[0.7RotationMatrix[tx,eta].zeta,{tx,0,Max[theta,0.01],0.05}];
psiarc = Table[0.7RotationMatrix[tx,zetaprime].etaprime,{tx,0,Max[psi,0.01],0.05}]];

Show[
(* x,y,z axes *)
Graphics3D[{Red,Arrow[Tube[{{0,0,0},{1,0,0}},0.02]]}],
Graphics3D[{Green,Arrow[Tube[{{0,0,0},{0,1,0}},0.02]]}],
Graphics3D[{Blue,Arrow[Tube[{{0,0,0},{0,0,1}},0.02]]}],
(* e1,e2,e3 axes *)
Graphics3D[{Red,Tube[{{0,0,0},xprime},0.02],Sphere[xprime,0.1]}],
Graphics3D[{Green,Tube[{{0,0,0},yprime},0.02],Sphere[yprime,0.1]}],
Graphics3D[{Blue,Tube[{{0,0,0},zprime},0.02],Sphere[zprime,0.1]}],
(* original equator *)
Graphics3D[{Gray,Cylinder[{{0,0,-0.005},{0,0,0.005}},0.7]}],
(* new equator *)
Graphics3D[{White,Cylinder[{-0.005zprime,0.005zprime},0.7]}],
(* intersection of the two *)
Graphics3D[{Black,Tube[{{0,0,0},0.7eta}]}],
(* e1a *)
Graphics3D[{Black,Tube[{{0,0,0},0.7xi}]}],
(* ϕ angle *)
Graphics3D[{Red,Tube[phiarc,0.03]}],
(* θ angle *)
Graphics3D[{Blue,Tube[thetaarc,0.03]}],
(* ψ angle *)
Graphics3D[{Green,Tube[psiarc,0.03]}],
If[label,
Graphics3D[{
Text[Style["x",Italic,FontSize->30],{1.2,0,0}],
Text[Style["y",Italic,FontSize->30],{0,1.2,0}],
Text[Style["z",Italic,FontSize->30],{0,0,1.2}],
Text[Style["x'",Italic,FontSize->30],1.3xprime],
Text[Style["y'",Italic,FontSize->30],1.3yprime],
Text[Style["z'",Italic,FontSize->30],1.3zprime]}],{}],
Graphics3D[{
Text[Style["θ",FontSize->30],0.85 etheta],
Text[Style["ϕ",FontSize->30],{0.85Cos[phi/2],0.85Sin[phi/2],0}],
Text[Style["ψ",FontSize->30],0.85epsi]}],
PlotRange->{{-1.4,1.4},{-1.4,1.4},{-1.4,1.4}},ViewPoint->{2,2,1},ImageSize->{450,480}, SphericalRegion-> True]];

Manipulate[
PlotEulerAngles[phi,theta,psi,label,convention],
Row[{"phi (", Style["ϕ"], ")"}],
{{phi, .5, ""},0,π,.01, Appearance->"Labeled" , ImageSize-> Tiny},
Row[{"theta (", Style["θ"], ")"}],
{{theta, .8, ""},0,π,.01, Appearance->"Labeled", ImageSize-> Tiny },
Row[{"psi (", Style["ψ"], ")"}],
{{psi, 1.2, ""},0,π,.01, Appearance->"Labeled", ImageSize-> Tiny },
Delimiter,
"axes labels",
{{label,False,""},{True,False}},
"convention",
{{convention, "x", ""},{"x"-> Style["x", Italic],"y"-> Style["y", Italic]}},
SaveDefinitions->True, ControlPlacement-> Left]

The Euler angles are a classical way to specify the orientation of an object in space with respect to a fixed set of coordinate axes. This Demonstration shows two of the several implementations of the Euler angles (ϕ,θ,ψ). The initial (x,y,z) axes are indicated by the red, green, and blue arrows, while the final (x',y',z') axes are indicated by the red, green, and blue spheres.

The Euler angles (ϕ,θ,ψ) are used to define a sequence of three rotations (x,y,z)->(ξ,η,ζ)->(ξ',η',ζ')->(x',y',z'), by the angles (ϕ,θ,ψ) about the z, ξ, or η, and ζ' axes, respectively. If the second rotation is about the ξ axis, this is called the "x convention". The net transformation is given by the matrix equation

(({{x'}, {y'}, {z'}}))=(({{cos ψ cos ϕ-cos θ sin ϕ sin ψ, cos ψ sin ϕ + cos θ cos ϕ sin ψ, sin ψ sin θ}, {-sin ϕ cos ϕ - cos θ sin ϕ cos ψ, -sin ψ sin ϕ + cos θ cos ϕ cos ψ,  cos ψ sin θ }, {sin θ sin ϕ, -sin θ cos ϕ, cos θ}}))(({{x}, {y}, {z}})).

This convention is used by Thornton and Marion [1] in Chapter 11.

If the second rotation is about the η axis, this is called the "y convention". The net transformation is given by the matrix equation

(({{x'}, {y'}, {z'}}))=(({{-sin ψ sin ϕ+cos θ cos ϕ cos ψ, sin ψ cos ϕ + cos θ sin ϕ cos ψ, -cos ψ sin θ }, {-cos ψ sin ϕ - cos θ cos ϕ sin ψ, cos ψ cos ϕ - cos θ sin ϕ sin ψ, sin ψ sin θ}, {sin θ cos ϕ, sin θ sin ϕ, cos θ}}))(({{x}, {y}, {z}})).

This convention is used by J. R. Taylor [2] in Chapter 10.

Both conventions are described by H. Goldstein [3] in Chapter 4.

See also Euler angles.

References

[1] S. T. Thornton and J. B. Marion, Classical Dynamics of Particles and Systems, Belmont, CA: Brooks/Cole, 2004.

[2] J. R. Taylor, Classical Mechanics, Mill Valley, CA: University Science Books, 2005.

[3] H. Goldstein, Classical Mechanics, Reading, MA: Addison-Wesley, 1980.

Contributed by: Frederick W. Strauch