Advertisement
VXP

LB1

VXP
Mar 5th, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.24 KB | None | 0 0
  1. private void button1_Click(object sender, EventArgs e)
  2.         {
  3.             chart1.Series[0].Points.Clear();
  4.             chart1.Series[1].Points.Clear();
  5.             chart1.Series[2].Points.Clear();
  6.             richTextBox1.Clear();
  7.             double y, z, w, x, A = Convert.ToDouble(textBox1.Text), B = Convert.ToDouble(textBox2.Text), h = Convert.ToDouble(textBox3.Text);
  8.             bool ch1, ch2, ch3; ch1 = ch2 = ch3 = false;
  9.             for (x = A; x <= B + 0.1 * h; x += h)
  10.             {
  11.                 y = Math.Atan(x + 3.1); z = Math.Exp(x); w = 1.5 * Math.Cos(x - Math.PI / 4 * Math.Exp(x));
  12.                 ch1 = checkBox1.Checked;
  13.                 if (ch1) chart1.Series[0].Points.AddXY(x, y);
  14.                 ch2 = checkBox2.Checked;
  15.                 if (ch2) chart1.Series[1].Points.AddXY(x, z);
  16.                 ch3 = checkBox3.Checked;
  17.                 if (ch3) chart1.Series[2].Points.AddXY(x, w);
  18.  
  19.                 richTextBox1.Text += " x = " + x.ToString("0.00");
  20.                 richTextBox1.Text += ((ch1) ? "  arctg(x + 3.1) = " +   y.ToString("0.00") : "");
  21.                 richTextBox1.Text += ((ch2) ? "  e^x = " +              z.ToString("0.00") : "");
  22.                 richTextBox1.Text += ((ch3) ? "  1.5cos(x - п/4*e^x) = " + w.ToString("0.##") : "");
  23.                 richTextBox1.Text += Environment.NewLine;
  24.             }
  25.             chart1.Series[0].IsVisibleInLegend = ch1;
  26.             chart1.Series[1].IsVisibleInLegend = ch2;
  27.             chart1.Series[2].IsVisibleInLegend = ch3;
  28.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement