5 * Revision 1.1.1.1 1995/10/24 10:21:24 cernlib
9 #include "geant321/pilot.h"
10 *CMZ : 3.21/02 06/07/94 18.28.55 by S.Giani
12 SUBROUTINE GFANG(P,COSTH,SINTH,COSPH,SINPH,ROTATE)
14 C. ******************************************************************
16 C. * Finds theta-phi angles for a particle with director cosines P *
17 C. * The logical flag ROTATE indicates whether the the director *
18 C. * cosines are along the Z axis (.FALSE.) or not (.TRUE.). *
21 C. * Author F.Carminati ********* *
24 C. ******************************************************************
27 #if !defined(CERNLIB_SINGLE)
28 DOUBLE PRECISION DUX, DUY, DUZ, DSITH2, ONE, DNORM
33 C. ------------------------------------------------------------------
39 IF(ABS(DUZ).GE.0.85) THEN
42 COSTH = SIGN(ONE,DUZ)*SQRT(ONE-DSITH2)
61 DSITH = SQRT((ONE+DUZ)*(ONE-DUZ))
63 DNORM = ONE/SQRT(DUX**2+DUY**2)