public Func3D(double xmin, double ymin, double xmax, double ymax, string label, zfunc zfunc) { _xmin = xmin; _ymin = ymin; _xmax = xmax; _ymax = ymax; _label = label; _zfunc = zfunc; }
private SpreadSurfaceChart CreateSurfaceChart(double xmin, double ymin, double xmax, double ymax, zfunc zfunc) { SpreadSurfaceChart chart = new SpreadSurfaceChart(); int n = 21; var zdata = new double[n, n]; var dx = (xmax - xmin) / (n - 1); var dy = (ymax - ymin) / (n - 1); for (int i = 0; i < n; i++) { SpreadDataSeries ds = new SpreadDataSeries(); ds.Values = new DoubleSeriesCollection(); for (int j = 0; j < n; j++) { double value = zfunc(xmin + i * dx, ymin + j * dy); ds.Values.Add(value); } chart.DataSeries.Add(ds); } return chart; }