public class function2D{ private static final double zero=0.0e0; private int nx, Imethod, Degree; private double x[], y[], z[], x0, x1, dx; private boolean Constant; function2D(int nx, int Imethod, int Degree, boolean Constant, double z[], double x0, double x1){ setNx(nx); this.Imethod = Imethod; this.Degree = Degree; isConstant(Constant); this.z = z; this.x0 = x0; this.x1 = x1; setup(); if(Imethod == 0)polynome(); if(Imethod == 1)linear(); } public void isConstant(boolean Constant) { this.Constant = Constant; } //Set the number of grid points, corresponding to the number //of (x, y) couples. public void setNx(int nx) { this.nx = nx; } public void setup() { x = new double[nx]; y = new double[nx]; dx = x1 - x0; dx /= (nx-1); } public void polynome() { int i, k, n; if(Constant){ n = Degree+1; for(i=0; i