Re: [ROOT] TRotation interface

From: Clark McGrew (clark.mcgrew@sunysb.edu)
Date: Sun Mar 30 2003 - 21:38:01 MEST


Hello,

Thanks for replying on a Sunday!  I've got a derived class to do
everything I need which only adds member functions.  I thought it might
be useful for others.

> It seems that all the functions that you require are already coded
> in the classes TRotation, TVector3 or TLorentzVector.

> > -- Methods to rotate euler angles 

I'm probably missing the interface.  The only way I can see to set a
rotation to a particular set of Euler angles is

TRotation toBeSet;

TRotation identity;
toBeSet = identity;
toBeSet.RotateZ(phi);
toBeSet.RotateX(theta);
toBeSet.RotateZ(psi);

I think

toBeSet.SetEuler(phi,theta,psi);
toBeSet.SetPhi(phi);
toBeSet.SetTheta(theta);
toBeSet.SetPsi(psi);

would be useful. (as well as Get methods).

> > -- A method to "validate" the rotation matrix

This isn't really necessary, but numeric error can accumulated after
many transformations.  I don't see the interface.

> > -- [Set the ZAxis]

Once again, I don't see an equivalent interface.  I'd prefer:

TRotation toBeSet;
TVector3 zAxisDir, inXYPlane;

toBeSet.SetZAxis(zAxisDir,inXYPlane);

The only way I can see to get this is:

TRotation identity;
toBeSet = identity;
TVector3 zAxis = zAxisDir.Unit();
TVector3 yAxis = (zAxis.Cross(inZXPlane)).Unit();
TVector3 xAxis = yAxis.Cross(zAxis);
toBeSet.RotateAxes(xAxis,yAxis,zAxis);

But, this doesn't have error checking.  I've also written SetXAxis and
SetYAxis.

I hope this isn't a simple case of misunderstanding the TRotation class,
but for the moment I've derived a class to implement all of these
methods and would be happy to send a patched TRotation.

Thanks for looking at this on a weekend,

Sincerely,
Clark
-- 
Clark McGrew <clark.mcgrew@sunysb.edu>
University at Stony Brook, Dept. of Physics and Astronomy



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:10 MET