There are two problems, please suggest what is wrong:

1) Need to draw two graphs of functions. The functions are drawn, but in the same colors, although I also set colors in the 'Series' section in the chart parameters and using separate methods.

2) When you click on the solveButton button, the first function is drawn first and only after the second one is pressed again.

Code:

private void button1_Click(object sender, EventArgs e) { int n = Convert.ToInt32(nBox.Text); // ΠΊΠΎΠ»-Π²ΠΎ Ρ‚ΠΎΡ‡Π΅ΠΊ(иксов) double[] xs = new double[n]; //иксы double[] fxs = new double[n]; //Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅ Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΈ Π² иксС double[] result = new double[n]; // Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅ ΠΈΠ½Ρ‚Π΅Ρ€ΠΏΠΎΠ»ΠΈΡ€ΠΎΠ²Π°Π½Π½ΠΎΠΉ Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΈ for (int i = 0; i < n; i++) { xs[i] = (Math.PI / n) * (i + 1); fxs[i] = Function(xs[i]); result[i] = NDDP(xs[i], n, xs, fxs); chart1.Series["default"].Points.AddXY(xs[i], Function(xs[i])); chart1.Series["interpolated"].Points.AddXY(xs[i], result[i]); } } 
  • This is not a faq. In general, 3 out of 5 tags are superfluous. - Qwertiy ♦
  • Found a bug, the topic is closed. - vdublevsky

0