5 * Revision 1.1.1.1 1995/10/24 10:20:53 cernlib
9 #include "geant321/pilot.h"
10 *CMZ : 3.21/02 29/03/94 15.41.30 by S.Giani
12 SUBROUTINE GNOTR9(X,Y,Z,N1,N2,N3,N4)
13 C. ******************************************************************
15 C. * GNOTR9 checks coplanarity of the face described by the *
16 C. * indices N1,N2,N3,N4 into the vertex array X,Y,Z. *
17 C. * This check is perfomed since shape TRAP is described by *
18 C. * 11 values in the parameter array of which only 9 are *
20 C. * Called by : GNOTR2
21 C. * Author R.Nierhaus ********* *
23 C. ******************************************************************
25 #include "geant321/gcunit.inc"
27 DIMENSION X(8),Y(8),Z(8)
29 A=-((Y(N2)-Y(N1))*(Z(N3)-Z(N1))-(Y(N3)-Y(N1))*(Z(N2)-Z(N1)))
30 B=-((Z(N2)-Z(N1))*(X(N3)-X(N1))-(Z(N3)-Z(N1))*(X(N2)-X(N1)))
31 C=-((X(N2)-X(N1))*(Y(N3)-Y(N1))-(X(N3)-X(N1))*(Y(N2)-Y(N1)))
32 V=(X(N4)-X(N1))*A+(Y(N4)-Y(N1))*B+(Z(N4)-Z(N1))*C
33 IF (ABS(V)/SQRT(A**2+B**2+C**2).GT.1.E-3) THEN
36 1001 FORMAT (' GNOTR9 ...TRAP shape : surface not coplanar')