6
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – J. M. will be back soon Jun 29 '16 at 2:29
  • 2
    $\begingroup$ @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. $\endgroup$ – Rahul Jun 29 '16 at 2:31
  • $\begingroup$ @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? $\endgroup$ – J. M. will be back soon Jun 29 '16 at 2:36
  • 1
    $\begingroup$ 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" α. $\endgroup$ – george2079 Jun 29 '16 at 2:50
  • $\begingroup$ "active vs passive rotations" Ah right, that's what those things are called. Thanks @george2079! $\endgroup$ – Rahul Jun 29 '16 at 2:59
7
$\begingroup$

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[3]]

Manipulate[
 Graphics3D[{GeometricTransformation[arrowAxes[.7], 
    EulerMatrix[{α, β, γ}]], arrowAxes[]}, 
  Background -> LightGray, Boxed -> False, 
  PlotLabel -> Framed[
   Row[{"α = ", α, ", β = ", β, ", γ = ", γ}]], LabelStyle -> Larger],
 {α, 0, Pi}, {β, 0, Pi}, {γ, 0, Pi}]

Mathematica graphics

$\endgroup$
  • $\begingroup$ what is arrowAxes ? It doesn't work for me. $\endgroup$ – Orders Jun 29 '16 at 5:18
  • $\begingroup$ Sorry, I forgot to add that. Now it's in. $\endgroup$ – Jens Jun 29 '16 at 5:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.