Previous: fitin Up: ../plot79_f.html Next: fitk2


FITK1

       SUBROUTINE  FITK1 (N, X, Y, SLP1, SLPN, XP, YP, TEMP, S, SIGMA)
 C$    (Planar Tensioned Spline Fit)
 C$    This subroutine  determines  the  parameters  necessary  to
 C$    compute a spline under  tension passing through a  sequence
 C$    of  pairs  (X(1),Y(1),...,X(N),Y(N))  in  the  plane.   The
 C$    slopes at the  two ends of  the curve may  be specified  or
 C$    omitted.  For actual computation of points on the curve  it
 C$    is necessary to call the subroutine FITK2.
 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$    SLP1 and SLPN......contain the desired values for the slope
 C$             of  the  curve  at  (X(1),Y(1))  and  (X(N),Y(N)),
 C$             respectively.  These quantities are in degrees and
 C$             measured  counterclockwise   from   the   positive
 C$             X-axis.   The  positive  sense  of  the  curve  is
 C$             assumed to  be that  moving from  the point  1  to
 C$             point N.  If the quantity SIGMA is negative, these
 C$             slopes will be determined internally and the  user
 C$             need only  furnish  place-holding  parameters  for
 C$             SLP1 and SLPN.  Such place-holding parameters will
 C$             be ignored but not destroyed,
 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 N which is used for
 C$             scratch storage,
 C$    SIGMA....contains the tension factor.  This is non-zero and
 C$             indicates the curviness desired.  If ABS(SIGMA) is
 C$             very large  (e.g. 50.0),  the resulting  curve  is
 C$             very nearly a polygonal  line.  The sign of  SIGMA
 C$             indicates whether slope information has been input
 C$             or not.   If  SIGMA  is  negative,  the  end-point
 C$             slopes will be determined internally.  A  standard
 C$             value for SIGMA is  approximately 1.0 in  absolute
 C$             value.
 C$
 C$    On output--
 C$
 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$    N,X,Y,SLP1,SLPN, and SIGMA.....are unaltered,
 C$
 C$    Author:  A.K. Cline,   "Scalar  and  Planar  Valued   Curve
 C$             Fitting Using Splines Under Tension", Comm. A.C.M.
 C$             17, 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$    (20-JUL-89)