The Cubic Splines Program
This program calculates a sequence of cubic polynomials that form a continuous curve intersecting all the points you enter.
Introduction
The Cubic Splines program enables you to interpolate between known points more accurately than linear interpolation when the known points do not lie along a straight line. The technique used by cubic splines assumes the points lie along a curve whose second derivative is continuous over the entire interval of known data.The number of points you enter is designated as m. You must partition for at least 6m + 4 registers before running the program, and the program requires at least three data points.
The program fits cubic polynomials to successive points in the other the points are entered. Therefore, it is important to enter the points in the order that they occur along the curve.
The program lets you specify the derivatives of the endpoints, f″(xi) and f″(xm), in either of two ways.
- You can let the program use second derivatives of zero at the endpoints.
- You can enter the actual second derivatives at the endpoints for a more accurate fit.
Reference
Numerical Methods, Robert W. Hornbeck, Quantum Publishers, Inc., 1975, pp. 47-50.☚ Back