SysIII/usr/src/man/man1/spline.1g
'\" e
.TH SPLINE 1G
.SH NAME
spline \- interpolate smooth curve
.SH SYNOPSIS
.B spline
[ options ]
.SH DESCRIPTION
.I Spline\^
takes pairs of numbers from the standard input as abscissas and ordinates
of a function.
It produces a similar set, which
is approximately equally spaced and
includes the input set, on the standard output.
The cubic spline output
(R. W. Hamming,
.IR "Numerical Methods for Scientists and Engineers" ,
2nd ed., pp.\ 349ff)
has two continuous derivatives,
and sufficiently many points to look smooth when plotted, for
example by
.IR graph (1G).
.PP
The following
.I options\^
are recognized,
each as a separate argument:
.TP .5i
.B \-a
Supply abscissas automatically (they are missing from
the input); spacing is given by the next
argument, or is assumed to be 1 if next argument is not a number.
.TP
.B \-k
The constant
.I k\^
used in the boundary value computation:
.RS
.RS
.EQ
tdefine prime2 'sup down 20 \(fm\(fm'
ndefine prime2 'sup \(fm\(fm'
y sub 0 prime2 ~=~ ky sub 1 prime2 , ~~~~ y sub n prime2 ~=~ ky sub n-1 prime2
.EN
.RE
is set by the next argument
(default
.I k\^
= 0).
.RE
.TP .5i
.B \-n
Space output points
so that approximately
.I n\^
intervals occur between the lower and upper
.I x\^
limits
(default
.I n\^
= 100).
.TP
.B \-p
Make output periodic, i.e., match
derivatives at ends.
First and last input values should normally agree.
.TP
.B \-x
Next
1 (or 2) arguments are lower (and upper)
.I x\^
limits.
Normally, these limits are calculated from the data.
Automatic abscissas start at lower limit
(default 0).
.SH SEE ALSO
graph(1G).
.SH DIAGNOSTICS
When data is not strictly monotone in
.IR x ,
.I spline\^
reproduces the input without interpolating extra points.
.SH BUGS
A limit of 1,000 input points is enforced silently.