Message: Re: Angle distribution from direction cosines Not Logged In (login)

## Re: Angle distribution from direction cosines

Forum: Particles
Re: Angle distribution from direction cosines (valentina)
Date: 04 Feb, 2008
From: Marc Verderi <Marc Verderi>

 ```Hi Valentina, I am a bit surprised by the "-" signs, but assuming this is due to some convention (I'm unfamiliar with gps) you can calculate the angles as: q = acos(-Pz) f = atan2(-Py, -Px) The atan2 function takes care of the sign of "-Py" to put the f angle in the right part of the trigonometric circle. Cheers, Marc PS: if the "-" signs are not there, just remove them everywhere in the q and f expressions. valentina a écrit : > *** Discussion title: Particles > Email replies to PublicHyperNews@slac.stanford.edu must include: > In-Reply-To: <"/particles/383"@geant4-hn.slac.stanford.edu> > Subject: ...change this to be about your reply. > > Hi, my Geant4 output file gives me the direction cosines (DX, DY, DZ) of > the particle. I have to calculate theta and phi (spherical coordinates) > from these cosines and I'm using: > > theta = acos(-MZ) phi = atan(DY/DX) > > >From the GPS Users Manual I have found: > > The direction cosines are calculated as > > Px = - sin(q) cos(f) > Py = - sin(q) sin(f) > Pz = - cos(q) > > The problem is that the result is bit strange and I don't know if I'm > using a wrong transformation. Can someone help me? > > Thanks! Valentina > ```

 Inline Depth: Outline Depth: Add message:

1 Re: Angle distribution from direction cosines   (michel maire - 04 Feb, 2008)
Re: Angle distribution from direction cosines   (Vladimir IVANTCHENKO - 05 Feb, 2008)
 to: "Re: Angle distribution from direction cosines"
This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]