# The new introduced EulerMatrix problem

In the present version of Mathematica, there is a new command

EulerMatrix[{α, β, γ}])// MatrixForm


I read its document and I still don't understand it. For me, the result should be the inverse of EulerMatrix based on the same convention. See this.

Update:

Problem for me is, for the Euler rotation, we are rotating the coordinate system. (α, β, γ) is to describe rotations or relative orientations of orthogonal coordinate systems. I think the Euler rotation should be

  Dot[RotationMatrix[-γ, {0, 0, 1}],
RotationMatrix[-β, {0, 1, 0}],
RotationMatrix[-α, {0, 0, 1}]]// MatrixForm


RotationMatrix[α, {0, 0, 1}] is the rotation of α for z in counterclockwise and active way. But we are rotating the Z axis, which is equivalent to the passive transformation. So we use -α in RotationMatrix[-α, {0, 0, 1}]. This is consistent with the this.

• In any case, the description "rotating α around the current z axis, then β around the current y axis, and then γ around the current z axis" in the docs seems to be off, since EulerMatrix[{α, β, γ}] == RotationMatrix[α, {0, 0, 1}].RotationMatrix[β, {0, 1, 0}].RotationMatrix[γ, {0, 0, 1}], which implies the reverse ordering. RollPitchYawMatrix[{α, β, γ}, {3, 2, 3}] seems to be the correct ordering. – J. M.'s technical difficulties Jun 29 '16 at 2:29
• @J.M.: I think the behavior is consistent with the documentation because it states rotating about the "current" axes, which I assume to mean the axes in the local frame (a.k.a. body frame), rather than the world axes which is what you are using. – user484 Jun 29 '16 at 2:31
• @Rahul, I'm still confused. If "rotating α around the current z axis" is the first step, then one is looking at RotationMatrix[α, {0, 0, 1}] being applied first to the vectors being acted on, no? But the current definition applies it last. What am I missing here? – J. M.'s technical difficulties Jun 29 '16 at 2:36
• see the note about active vs passive rotations on the linked site and here en.wikipedia.org/wiki/Active_and_passive_transformation . I believe mathematica is giving the active form and the linked site the passive. In any case the mathematica description is weak "rotating α around"? surely we are not rotating α, rather rotating something "by" α. – george2079 Jun 29 '16 at 2:50
• "active vs passive rotations" Ah right, that's what those things are called. Thanks @george2079! – user484 Jun 29 '16 at 2:59

To verify that the rotations happen the way they're supposed to according to the documentation for EulerMatrix, you could use the following Manipulate:

Clear[arrowAxes];
arrowAxes[arrowLength_: 1] :=
Map[{Apply[RGBColor, #], Arrow[Tube[{-#, #}]]} &,
arrowLength IdentityMatrix]

Manipulate[
Graphics3D[{GeometricTransformation[arrowAxes[.7],
EulerMatrix[{α, β, γ}]], arrowAxes[]},
Background -> LightGray, Boxed -> False,
PlotLabel -> Framed[
Row[{"α = ", α, ", β = ", β, ", γ = ", γ}]], LabelStyle -> Larger],
{α, 0, Pi}, {β, 0, Pi}, {γ, 0, Pi}] • what is arrowAxes ? It doesn't work for me. – Orders Jun 29 '16 at 5:18
• Sorry, I forgot to add that. Now it's in. – Jens Jun 29 '16 at 5:21