This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / ghits / gcubs.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:21:08  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.20  by  S.Giani
11 *-- Author :
12       SUBROUTINE GCUBS(X,Y,D1,D2,A)
13 C.
14 C.
15 C.    ******************************************************************
16 C.    *                                                                *
17 C.    *       Calculates a cubic through P1,(-X,Y1),(X,Y2),P2          *
18 C.    *       where Y2=-Y1                                             *
19 C.    *        Y=A(1)+A(2)*X+A(3)*X**2+A(4)*X**3                       *
20 C.    *        The coordinate system is assumed to be the cms system   *
21 C.    *        of P1,P2.                                               *
22 C.    *                                                                *
23 C.    *    ==>Called by : GIPLAN,GICYL                                 *
24 C.    *       Author    H.Boerner  *********                           *
25 C.    *                                                                *
26 C.    ******************************************************************
27 C.
28       REAL X,Y,D1,D2,A(4)
29 C.
30 C.
31 C.    ------------------------------------------------------------------
32 C.
33 C.
34       IF (X.EQ.0.)                               GO TO 10
35 C
36 C
37       FACT   = (D1 - D2) * 0.25
38       A(1)   = - 1. * FACT * X
39       A(3)   = FACT / X
40       A(2)   = (6. * Y - (D1 + D2) * X) / (4. * X)
41       A(4)   = ((D1 + D2)*X - 2.*Y) / (4.*X**3)
42       RETURN
43 C
44   10  A(1)   = 0.
45       A(2)   = 1.
46       A(3)   = 0.
47       A(4)   = 0.
48       END