This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / gheisha / gpdk.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:20:59  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.38  by  S.Giani
11 *-- Author :
12       FUNCTION GPDK(A,B,C)
13 C
14 C *** NVE 16-MAR-1988 CERN GENEVA ***
15 C
16 C CALLED BY : PHASP
17 C ORIGIN : H.FESEFELDT (27-OCT-1983)
18 C
19 C     GPDK = SQRT(A*A+(B*B-C*C)**2/(A*A) - 2.0*(B*B+C*C))/2.0
20 C
21       A2 = A*A
22       B2 = B*B
23       C2 = C*C
24       IF(A2) 21,21,61
25    61 CONTINUE
26       ARG=A2+(B2-C2)**2/A2-2.0*(B2+C2)
27       IF (ARG) 21,21,31
28    21 GPDK=0.0
29       GOTO 41
30    31 CONTINUE
31       GPDK = 0.5*SQRT(ABS(A2 + (B2-C2)**2/A2 - 2.0*(B2+C2)))
32    41 CONTINUE
33       RETURN
34       END