SplineCL
SplineCL determines the coefficients for a cubic spline interpolating
function from a sequence of data-points
. It
determines the coefficients
in the piecewise
cubic interpolating function:
SplineCL.) The
interpolating function passes through the data points and has a
continuous first and second derivative everywhere. Once calculated,
the interpolating function can be evaluated using
SplineValCL.
| void SplineCL ( |
int n, |
| double *x, |
|
| double *y, |
|
| double *b, |
|
| double *c, |
|
| double *d); |
|
| n |
The number of data points. | |
| x |
Array holding the sequence
|
|
| y |
Array holding the sequence
|
|
| b |
Array to hold the coefficients
|
|
| c |
Array to hold the coefficients
|
|
| d |
Array to hold the coefficients
|
The example program b04splin.c demonstrates the use of SplineCL.
SplineValCL
Once SplineCL has been used to calculate the
cubic spline interpolating function for a dataset
,
the routine SplineValCL can be used to evaluate it at an arbitrary point.
| double SplineValCL ( |
int n, |
| double x, |
|
| double *xpts, |
|
| double *y, |
|
| double *b, |
|
| double *c, |
|
| double *d); |
|
| n |
The number of data points. | |
| x |
The point at which the interpolating function is to be evaluated. | |
| xpts |
Array holding the sequence
|
|
| y |
Array holding the sequence
|
|
| b |
Array to hold the coefficients
|
|
| c |
Array to hold the coefficients
|
|
| d |
Array to hold the coefficients
|
The example program b04splin.c demonstrates the use of SplineValCL.