Scientific Computing

This module illustrates piecewise cubic interpolation, both Hermite
cubic and cubic spline. Given a set of data points
*t*_{i},
*y*_{i})*i* =
1,…,*n**t*_{1} <
*t*_{2} < · · · <
*t*_{n},*different* cubic polynomial in each subinterval
*t*_{i},
*t*_{i+1}]

The user chooses a set of data points either by selecting one of two
preset examples or by specifying an arbitrary set of points. For the
latter, select *Choose Points* and then click on the graph to
specify the location of each point, followed by *Apply*. At least
four points are required to define a piecewise cubic interpolant. To
prevent points from being too close to each other, no new point can be
selected within the shaded buffer zone around each existing point.
After the points have been specified, a piecewise cubic interpolant is
drawn through the data points. The user can choose the type of
piecewise cubic interpolant, and in some cases can control additional
parameters related to the type of interpolant. Except for the
monotonic Hermite cubic interpolant, the available choices are all
cubic splines. After an interpolant has been drawn, another point can
be added by selecting *Add Point* and then clicking on the graph
at the desired location, whereupon the resulting new interpolant is
drawn.

A periodic cubic spline is most appropriate for periodic data, but for nonperiodic data the first and second derivatives can still be equated at the endpoints, and this strategy is implemented here. Similarly, a monotonic Hermite cubic interpolant is most appropriate for monotonic data, but for nonmonotonic data, the interpolant can be forced to be monotonic on each subinterval in which the data are montonic, as implemented here.

**Reference:** Michael T. Heath, *Scientific Computing,
An Introductory Survey*, 2nd edition, McGraw-Hill, New York,
2002. See Section 7.4; Example 1 is shown in Figures 7.9 and 7.10 on
page 329, and Example 2 is given in Computer Problem 7.5 on page 337.

**Developers:** Evan VanderZee and Michael Heath