5 * Revision 1.1.1.1 1995/10/24 10:20:57 cernlib
9 #include "geant321/pilot.h"
10 *CMZ : 3.21/02 29/03/94 15.41.31 by S.Giani
13 INTEGER FUNCTION GVSIGN (XYZ, C0, C, NC)
14 ************************************************************************
16 * Calculate the sign of the given point in relation YB 870424 *
17 * to the surface VP 880312 *
19 * Input : XYZ - point to be tested *
20 * C0 - first coefficient of surface *
21 * C - coefficients of surface in the standart form *
22 * ,the first one is taken from C1 *
23 * NC - number of coefficients (4,7, 10) *
25 * Output : -1, 0, +1 depending on side *
27 ************************************************************************
28 COMMON /SLATE/ SLATE (40)
30 EQUIVALENCE (SLATE,ISLATE)
32 EQUIVALENCE (TMP,SLATE(1))
33 *-----------------------------------------------------------------------
35 #if defined(CERNLIB_GVCONT)
39 GO TO (10013,10002,10013,10004,10013
40 +, 10013,10007,10013,10013,10010),NC
41 10013 CALL ZFATAM('GVSIGN. WRONG length')
50 TMP = -C0**2 + XYZ(1)**2 + XYZ(2)**2
54 10004 TMP = C0+C(1)*XYZ(1)+C(2)*XYZ(2)+C(3)*XYZ(3)
57 * 2nd order boundary, short case
59 ++XYZ(1)*(C(1)+C(4)*XYZ(1))
60 ++XYZ(2)*(C(2)+C(5)*XYZ(2))
61 ++XYZ(3)*(C(3)+C(6)*XYZ(3))
63 * 2nd order boundary, general case
65 ++XYZ(1)*(C(1)+C(4)*XYZ(1)+C(7)*XYZ(2))
66 ++XYZ(2)*(C(2)+C(5)*XYZ(2)+C(8)*XYZ(3))
67 ++XYZ(3)*(C(3)+C(6)*XYZ(3)+C(9)*XYZ(1))