.BG
.FN spline
.TL
Cubic Spline Approximation
.CS
spline(x, y, n=100, periodic=FALSE, boundary=0,
       xmin=min(x), xmax=max(x))
.AG x,y
\f2x\fP- and \f2y\fP-coordinates of points on a function to be approximated.
This argument may be a list containing components named `x' and `y'.
.AG n
desired number of output points.
.AG periodic
logical, is the function periodic?
If `TRUE', the `y'-values at `min(x)' and `max(x)' should agree
and the output will have derivatives matched at these end points.
.AG boundary
constant used in boundary value computation.  The second derivative of the
output function at the end points will be `boundary' times the second derivative
at the adjacent point.
.AG xmin,xmax
output `x' values will be spaced in `n' equal increments from `xmin' to `xmax'.
.RT
list containing components named `x' and `y' with the results
of the cubic spline fitting.
The spline output has two continuous derivatives and goes exactly through the
input points.
.br
.ne 3
.SH REFERENCE
The function was derived from the UNIX system command "spline", which
gives the following reference:
R. W. Hamming,
.ul
Numerical Methods for Scientists and Engineers,
2nd ed., pp. 349ff.
.EX
lines(spline(myx,myy))	# draw smooth curve through data
.KW dplot
.WR
