Previous: fitk2 Up: ../plot79_f.html Next: fitp2
SUBROUTINE FITP1 (N, X, Y, XP, YP, TEMP, S, SIGMA) C$ (Closed Curve Tensioned Spline Fit) C$ This subroutine determines the parameters necessary to C$ compute a spline under tension forming a closed curve in C$ the plane and passing through a sequence of pairs C$ (X(1),Y(1)),...,(X(N),Y(N)). For actual computation of C$ points on the curve it is necessary to call SUBROUTINE C$ FITP2. C$ C$ On input-- C$ C$ N........is the number of points to be interpolated C$ (N.GE.2), C$ X(*).....is an array containing the N X-coordinates of the C$ points, C$ Y(*).....is an array containing the N Y-coordinates of the C$ points, C$ XP(*)....is an array of length at least N, C$ YP(*)....is an array of length at least N, C$ TEMP(*)..is an array of length at least 2*N, which is used C$ for scratch storage, C$ SIGMA....contains the tension factor. This is a non-zero C$ quantity (whose sign is ignored) which indicates C$ the curviness desired. If ABS(SIGMA) is very C$ large (e.g. 50.0) the resulting curve is very much C$ like a polygon. A standard value for SIGMA is C$ approximately 1.0 in absolute value. C$ C$ On output-- C$ C$ N,X,Y, and SIGMA.....are unaltered, C$ XP and YP.....contain information about the curvature of C$ the curve at the given nodes, C$ S........contains the polygonal arclength of the curve. C$ C$ Author: A.K. Cline, "Scalar and Planar Valued Curve Fitting C$ Using Splines Under Tension", Comm. A.C.M. 17, C$ 218-225 (1974). (Algorithm 476). C$ C$ Modifications by Nelson H.F. Beebe, Department of Chemistry C$ Aarhus University, Aarhus, Denmark, to provide a more C$ transportable program, and to compute SINH(X) more C$ accurately than 0.5*(EXP(X)-EXP(-X)) for small arguments. C$ (03-APR-82)