spline(1)

NAME
spline - interpolate using splines under tension

SYNOPSIS
spline [filename] [options]

DESCRIPTION
Without options, spline reads pairs of numbers (x- and y-values) from the standard input (or the given file), generates a smooth curve through the points, and writes to the standard output points from the smooth curve. The curve is a spline under tension (see references), which is somewhat "tighter" than a cubic spline, and less likely to have spurious inflection points. As with graph, each pair of points may optionally be followed by a comment. If the comment is surrounded by quotes "...", it may contain spaces. The given points, and their comments if any, will be included in the output. Input lines starting with ";" are written to the beginning of the output file but are otherwise ignored. Blank lines are ignored. If the -c switch is not used, the input points must be from a function - that is, the x values must be strictly increasing. The output points will also be from a function. (If the -b switch is used, this restriction applies only within each segment.) If the -c switch is used (indicating a general curve), the input points need not be from a function, but each pair of points must be separated from the previous pair by a finite distance. (If the -b switch is used, this restriction applies only within each segment.)

OPTIONS

-a [step [start]]
    Input data contains only y values - generate automatic abscissas at intervals of step (default 1) starting at start (default 0).

-b  break the interpolation at each label. That is, the input curve is divided into sections with the last point in each section marked by a label (which may be empty: ""). A separate interpolating curve is to be found for each section. In this case, the requirements on the number of intervals (specified by the -n switch or defaulted) and the interpolation range (specified by the -x switch) are applied to each section independently.

-c  general curve rather than function. In this case, the curve is parameterized on the polygonal arclength from the first to the last given point, with the whole length scaled to be 1. Thus, the values min and max for the -x switch should satisfy 0 <= min < max <= 1.

-n num
    interpolate over num intervals (default is 100)

-t num
    Specify tension in interpolating curve. Tension of 50 gives almost polygonal line, tension of .01 gives almost cubic spline. Default is 1.

-x [min [max]]
    interpolate from min to max only. min and max should be in the range of the given x values, except that if the -c switch is used they should satisfy 0 <= min < max <= 1.

-xl take log of x values before interpolating, take exponential afterwards (probably necessary if -xl switch is needed for GRAPH) -yl take log of y values before interpolating, take exponential afterwards (probably necessary if -yl switch is needed for GRAPH)

NOTES
Similar to the Unix routine, except using splines under tension, passing labels through, and allowing general curves.

REFERENCES
A. K. Cline, "Scalar- and Planar- Valued Curve Fitting Using Splines Under Tension", Communications of the ACM v 17 n 4 p 218-223 (Apr 74). Schweikert, D. G. "An interpolation curve using a spline in tension", J. Math. and Physics v 45 p 312-317 (1966).

AUTHOR
Copyright (c) 1985 James R. Van Zandt Resale forbidden, copying for personal use encouraged.