]> git.uio.no Git - u/mrichter/AliRoot.git/blob - GEANT321/ggeom/gnotr2.F
100 parameters now allowed for geant shapes
[u/mrichter/AliRoot.git] / GEANT321 / ggeom / gnotr2.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:20:53  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.30  by  S.Giani
11 *-- Author :
12       SUBROUTINE GNOTR2(X,Y,Z,N1,N2,N3,N4,ABCD)
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C.    *     GNOTR2 computes the coefficients of the implicit           *
17 C.    *     normalized plane equation.                                 *
18 C.    *     These are called ABCD(1),ABCD(2),ABCD(3) and ABCD(4) in    *
19 C.    *     GNOTR2. They are stored in the parameter array             *
20 C.    *     respectively in P(12),P(13),P(14),P(15) for the first      *
21 C.    *     surface, P(16),P(17),P(18),P(19) for the second surface    *
22 C.    *     and so on. The face is formed by the half-edges            *
23 C.    *     N1-N2,N2-N3,N3-N4,N4-N1, where N1,N2,N3,N4 are the         *
24 C.    *     indices of the corresponding vertices.                     *
25 C.    *         Called by : GNOTR1                                     *
26 C.    *         Author  R.Nierhaus  *********                          *
27 C.    *                                                                *
28 C.    ******************************************************************
29 C.
30       DIMENSION X(8),Y(8),Z(8),ABCD(4)
31 *
32       CALL GNOTR9(X,Y,Z,N1,N2,N3,N4)
33 *
34       A=((Y(N2)-Y(N1))*(Z(N1)+Z(N2))+(Y(N3)-Y(N2))*(Z(N2)+Z(N3))
35      +  +(Y(N4)-Y(N3))*(Z(N3)+Z(N4))+(Y(N1)-Y(N4))*(Z(N4)+Z(N1)))
36       B=((Z(N2)-Z(N1))*(X(N1)+X(N2))+(Z(N3)-Z(N2))*(X(N2)+X(N3))
37      +  +(Z(N4)-Z(N3))*(X(N3)+X(N4))+(Z(N1)-Z(N4))*(X(N4)+X(N1)))
38       C=((X(N2)-X(N1))*(Y(N1)+Y(N2))+(X(N3)-X(N2))*(Y(N2)+Y(N3))
39      +  +(X(N4)-X(N3))*(Y(N3)+Y(N4))+(X(N1)-X(N4))*(Y(N4)+Y(N1)))
40       S=SQRT(A**2+B**2+C**2)
41       ABCD(1)=A/S
42       ABCD(2)=B/S
43       ABCD(3)=C/S
44       ABCD(4)=-(ABCD(1)*X(N1)+ABCD(2)*Y(N1)+ABCD(3)*Z(N1))
45 *
46       END