package com.imsl.test.example.math; import com.imsl.math.*; /** *

* Computes a cubic spline interpolant with * periodic boundary conditions.

* * A cubic spline interpolant to a function is computed. The value of the spline * at point 0.23 is printed. * * @see Code * @see Output * */ public class CsPeriodicEx1 { public static void main(String args[]) { int n = 11; double x[] = new double[n]; double y[] = new double[n]; double h = 2. * Math.PI / 15. / 10.; for (int k = 0; k < n; k++) { x[k] = h * (double) (k); y[k] = Math.sin(15.0 * x[k]); } CsPeriodic cs = new CsPeriodic(x, y); double csv = cs.value(0.23); System.out.println("The computed cubic spline value at point .23 is " + csv); } }