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 SUBROUTINE GVGRAD (XYZ, C, NC, GRA)
14 ************************************************************************
16 * GVGRAD calculates the gradient vector of a surface VP 880314 *
18 * Input : XYZ coordinates of the point *
19 * C(1) number of non constant coefficients of the *
21 * C(2),C(3),... non constant coefficients of the surface *
22 * NC total number of coefficients of the surface *
24 * Output : GRA gradient vector of the surface *
26 ************************************************************************
27 REAL XYZ(3) , C(*), GRA(3)
28 *-----------------------------------------------------------------------
30 * case with simplified surface X=C0, Y=C0, Z=C0, X*2+Y*2=C0
31 * (happens only when initialisation is done)
48 * case with surfaces with 4, 7 or 10 coefficients (normal case)
53 IF (NC.EQ.4) GO TO 999
55 * case with surfaces with 7 or 10 coefficients
58 100 GRA(I) = GRA(I) + 2.*C(I+4)*XYZ(I)
59 IF (NC.NE.10) GO TO 999
61 * case with surfaces with 10 coefficients
63 GRA(1) = GRA(1) + C(8)*XYZ(2)+C(10)*XYZ(3)
64 GRA(2) = GRA(2) + C(8)*XYZ(1)+C( 9)*XYZ(3)
65 GRA(3) = GRA(3) + C(9)*XYZ(2)+C(10)*XYZ(1)