// @export "interpolatedDoublesCurveDemo"
public static void interpolatedDoublesCurveDemo(PrintStream out) {
double[] xdata = {1.0, 2.0, 3.0};
double[] ydata = {2.0, 4.0, 6.0};
LinearInterpolator1D interpolator = new LinearInterpolator1D();
Curve<Double, Double> curve = new InterpolatedDoublesCurve(xdata, ydata, interpolator, true);
out.println(curve.getYValue(1.0));
out.println(curve.getYValue(2.0));
out.println(curve.getYValue(3.0));
out.println(curve.getYValue(1.5));
try {
out.println("Trying to get y value for too large an x...");
curve.getYValue(4.0);
} catch (java.lang.IllegalArgumentException e) {
out.println("IllegalArgumentException called");
}
}