Documentation of Math::RotationZYX

I am having issues understanding the documentation provided for the ROOT::Math::RotationZYX class. On the doxygen (here: https://root.cern.ch/doc/v610/classROOT_1_1Math_1_1RotationZYX.html ) it says:

Rotation class with the (3D) rotation represented by angles describing first a rotation of an angle phi (yaw) about the Z axis, followed by a rotation of an angle theta (pitch) about the new Y’ axis, followed by a third rotation of an angle psi (roll) about the final X’’ axis.

I understand this as the description of an intrinsic 321 Euler rotation since the second and third rotations are performed around the new axes. However, a simple example seems to prove me wrong:

Consider the following expression:

ROOT::Math::XYZVector result = ROOT::Math::RotationZYX(0.5*Pi(), 0, 0.5*Pi())*ROOT::Math::XYZVector(0, 0, 1)

Now, consider the following two interpretations:

Intrinsic:

Following the description on the documentation page (ie. interpreting this as intrinsic rotations) I would expect the following result - starting from a right-handed Cartesian coordinate system:

  • Start with right-handed coordinate system: x left, y up, z away from you

  • Rotate around z, so now x' up, y' right, z' away

  • Do not rotate around y'

  • Rotate around x'', so now x''' up, y''' away from you, z''' to the left

  • For intrinsic rotations, I would expect the result of the rotation to be (1,0,0)

Extrinsic:

However, this does not match with the result I receive from ROOT when executing the above example. Instead, what I get is along the following lines - interpreting the rotations as extrinsic:

  • Start with right-handed coordinate system: x left, y up, z away from you
  • Rotate around z, so now x' up, y' right, z' away
  • Do not rotate around y
  • Rotate around x (which is equivalent to -y'), so now x''' away from you, y''' to the right, z''' down
  • For extrinsic rotations, I would expect (0,-1,0) - and this is what I receive from ROOT.

To summarize, the documentation of RotationZYX seems to suggest an intrinsic rotation, but what ROOT actually performs is an extrinsic rotation.

Could you please point me to my mistake?

You are right. Either the documentation is wrong, or the code itself is wrong.

Thanks, I opened a ticket for the issue: https://sft.its.cern.ch/jira/browse/ROOT-9084

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.