Previous: fitc1 Up: ../plot79_f.html Next: fitcf


FITC2

       REAL FUNCTION  FITC2 (T, N, X, Y, YP, SIGMA, IT)
 C$    (Tensioned Spline Interpolation)
 C$    This function interpolates a curve at a given point using a
 C$    spline under tension.   SUBROUTINE FITC1  should be  called
 C$    earlier to determine certain necessary parameters.
 C$
 C$    On input--
 C$
 C$    T..........contains a REAL value to be mapped onto the
 C$               interpolating curve.
 C$    N..........contains the number of points which were
 C$               interpolated to determine the curve,
 C$    X and Y....are arrays containing the ordinates and abcissas
 C$               of the interpolated points,
 C$    YP.........is an array with values proportional to the
 C$               second derivative of the curve at the nodes
 C$    SIGMA......contains the tension factor (its sign is
 C$               ignored)
 C$    IT.........is an  INTEGER  switch.   If  IT is  not 1, this
 C$               indicates that  the  function  has  been  called
 C$               previously  (with  N,  X,   Y,  YP,  and   SIGMA
 C$               unaltered) and that this value of T exceeds  the
 C$               previous  value.   With  such  information   the
 C$               function is  able to  perform the  interpolation
 C$               much  more  rapidly.    If  a   user  seeks   to
 C$               interpolate at a sequence of points,  efficiency
 C$               is gained by ordering the values increasing  and
 C$               setting IT to the index of the call.  If IT is 1
 C$               the  search  for   the  interval   (X(K),X(K+1))
 C$               containing T starts with K = 1.
 C$
 C$    The parameters N,X,Y,YP and SIGMA should be input unaltered
 C$    from the output of FITC1.
 C$
 C$    On Output--
 C$
 C$    FITC2......contains the interpolated value.  For T less
 C$               than X(1), FITC2 = Y(1).   For T greater than X(N),
 C$               FITC2 = Y(N).
 C$
 C$    None of the input parameters are altered.
 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)