public static void interpolatorExtrapolatorDoublesCurveDemo(PrintStream out) {
double[] xdata = {1.0, 2.0, 3.0};
double[] ydata = {2.0, 4.0, 6.0};
Interpolator1D interpolator = new LinearInterpolator1D();
Interpolator1D leftExtrapolator = new LinearExtrapolator1D(interpolator);
Interpolator1D rightExtrapolator = new LinearExtrapolator1D(interpolator);
Interpolator1D combined = new CombinedInterpolatorExtrapolator(interpolator, leftExtrapolator, rightExtrapolator);
Curve<Double, Double> curve = new InterpolatedDoublesCurve(xdata, ydata, combined, true);
out.println(curve.getYValue(1.0));