Message: Re: Angle distribution from direction cosines Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Angle distribution from direction cosines 

Forum: Particles
Re: Question 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.


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 must include:
>   In-Reply-To: <"/particles/383">
>   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:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Angle distribution from direction cosines   (michel maire - 04 Feb, 2008)
(_ None: Re: Angle distribution from direction cosines   (Vladimir IVANTCHENKO - 05 Feb, 2008)
 Add Message Add Message
to: "Re: Angle distribution from direction cosines"

 Subscribe Subscribe

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 ]