Sense of rotations with TGeoRotation

I do not understand how the sense of the rotation is defined for different
axes in a TGeoRotation matrix. Here is what I get from an interactive ROOT session:

root [0] TGeoRotation r1("r1",30,0,0); r1.Print();
matrix r1 - translation : 0  rotation : 1  scale : 0
  0.866025 -0.5            0   0
  0.5       0.866025       0   0
 -0          0             1   0
  0          0             0   1

OK. This makes sense, as the x,y axes get rotated by 30deg about z. However, now when I try a rotation about y, viz.,

root [1] TGeoRotation r2("r2",0,30,0); r2.Print();
matrix r2 - translation : 0  rotation : 1  scale : 0
  0.866025  -0    0.5            0
  0          1    0              0
 -0.5        0    0.866025       0
  0          0    0              1

Why is the sense of the rotation now different, i.e., the x,z axes are now rotated by -30deg about y? The third rotation looks fine.

Sorry if I am missing something obvious. It is late and I have been beating my head against some complicated rotations.



When you call :

TGeoRotation r2("r2",0,30,0);

the arguments represent the Euler rotation angles. I just copy the explanation from TGeoMatrix.cxx:

The 30 as second argument in your example is not the rotation about Y, but about X.
This is the so-called X-axis convention (there are plenty others) and you can find detailed explanations at:
The difference related to this rule is just that the resulting matrix is the inverse, since in TGeo matrices always applies to local points/vectors to convert them to master reference system. On the other hand, having a second look I found out that the X-convention that I used is not quite consistent, so I applied the necessary changes that you can find in the CVS version.

Sorry for the inconvenience,

Thank you for your reply. You are right about the axis used for the
second rotation, and now I see that the user’s guide also has the
same definition. I was confused from looking at the online
documentation for the TGeoRotation constructor at

So, I guess that needs to be fixed.
Thanks also for the pointer to the x-axis convention. I guess that I
am more used to the notation from the classic Goldstein textbook.
Plus, I seem to have had some plus/minus signs mixed up. I will take
another look at the rotations after upgrading ROOT.


Just to confirm. Everything seems OK with the latest CVS version of ROOT, and I have sorted out all my problems. Thank you.