public double[][] GetYData() { double min = f(0, 0), max = f(0, 0); double[][] res = new double[z.amount][]; double x_cur = x.min, z_cur = z.min; for (int i = 0; i < z.amount; i++) { res[i] = new double[x.amount]; for (int j = 0; j < x.amount; j++) { res[i][j] = f(x_cur, z_cur); if (res[i][j] > max) { max = res[i][j]; } if (res[i][j] < min) { min = res[i][j]; } x_cur += x.step; } z_cur += z.step; } y = new spacing(min, max, 0); return(res); }
public Horizon(Func <double, double, double> f, spacing x, spacing z) { this.x = x; this.z = z; this.f = f; yArr = GetYData(); }
private void buttonGo_Click(object sender, EventArgs e) { canvas.Refresh(); spacing x = new spacing(10, 100, 10); spacing z = new spacing(10, 100, 10); horizon = new Horizon(FPeaks, x, z); horizon.Draw(g, penDraw, canvas.Size); canvas.Update(); }
public void Transform(ref double x, ref double y)// ref double z) { x = (x - this.x.min) * scale + border; y = (this.y.max - y) * scale + border; //z = (z - this.z.min) * scale + border; }
double scale;//scale_x, scale_y, scale_z; public Transformator(Size size, spacing x, spacing y, spacing z) { scale = Math.Min(size.Height, size.Width) / (2 * (x.max - x.min)); }