package com.organization4242.delmgorb.Model;

import org.apache.commons.math3.analysis.interpolation.BicubicSplineInterpolatingFunction;
import org.apache.commons.math3.analysis.interpolation.BicubicSplineInterpolator;

import java.util.ArrayList;

/**
 * Created by ilya-murzinov on 24.02.14.
 */
public class InterpolatorModel {
    BicubicSplineInterpolator interpolator = new BicubicSplineInterpolator();

    public BicubicSplineInterpolatingFunction getFunction(ArrayList<Point3D> list) {
        double[] x = new double[]{-4,-3,-2,-1,1,2,3,4};
        double[] y = new double[]{-4,-3,-2,-1,1,2,3,4};
        double[][] f = new double[][]{new double[]{-4,-5,-9,-11,13,24,3,4,}, new double[]{-2,-6,-2,-1,0,2,5,4},
                new double[]{-4,-3,-2,-1,1,2,3,4}, new double[]{-4,-5,-9,-11,13,24,3,4,},
                new double[]{-4,-5,-9,-11,13,24,3,4,}, new double[]{-4,-3,-2,-1,1,2,3,4},
                new double[]{-4,-3,-2,-1,1,2,3,4}, new double[]{-2,-6,-2,-1,0,2,5,4}};

        return interpolator.interpolate(x, y, f);
    }
}

@@ -830,34 +830,34 @@
 double%5B%5D%7B-4,
--
 5,-
-9
+2
 ,-11,
+-
 13,24,3,4,%7D,
@@ -870,35 +870,35 @@
 ouble%5B%5D%7B-4,-
-3
+8
 ,-2,-
-1,1,2
+5,1,8
 ,3,4%7D,%0A     
@@ -925,32 +925,33 @@
 e%5B%5D%7B-4,-3,-2
+1
 ,-1,1,2,
 3,4%7D, new do
@@ -930,33 +930,33 @@
 4,-3,-21,-1,1,2,
-3
+0
 ,4%7D, new double%5B

Update InterpolatorModel.java