Re: [ROOT] TRotation interface

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Apr 01 2003 - 21:32:00 MEST


Hi Clark,

If you have these proposed functions written and documentated,
I will be happy to include them in the source.
Let me know, as well as Pasha (author of the original versions).

Rene Brun

On 30 Mar 
2003, Clark McGrew wrote:

> 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
> 



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