package com.imsl.test.example.math; import com.imsl.math.*; /** *
* Computes the Akima cubic spline.
* * An Akima cubic spline interpolant to a function is computed. The value of the * spline at point 0.25 is printed. * * @see Code * @see Output * */ public class CsAkimaEx1 { public static void main(String args[]) { int n = 11; double x[] = new double[n]; double y[] = new double[n]; for (int k = 0; k < n; k++) { x[k] = (double) k / (double) (n - 1); y[k] = Math.sin(15.0 * x[k]); } CsAkima cs = new CsAkima(x, y); double csv = cs.value(0.25); System.out.println("The computed cubic spline value at point .25 is " + csv); } }