Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void button1_Click(object sender, EventArgs e)
- {
- chart1.Series[0].Points.Clear();
- chart1.Series[1].Points.Clear();
- chart1.Series[2].Points.Clear();
- richTextBox1.Clear();
- double y, z, w, x, A = Convert.ToDouble(textBox1.Text), B = Convert.ToDouble(textBox2.Text), h = Convert.ToDouble(textBox3.Text);
- bool ch1, ch2, ch3; ch1 = ch2 = ch3 = false;
- for (x = A; x <= B + 0.1 * h; x += h)
- {
- y = Math.Atan(x + 3.1); z = Math.Exp(x); w = 1.5 * Math.Cos(x - Math.PI / 4 * Math.Exp(x));
- ch1 = checkBox1.Checked;
- if (ch1) chart1.Series[0].Points.AddXY(x, y);
- ch2 = checkBox2.Checked;
- if (ch2) chart1.Series[1].Points.AddXY(x, z);
- ch3 = checkBox3.Checked;
- if (ch3) chart1.Series[2].Points.AddXY(x, w);
- richTextBox1.Text += " x = " + x.ToString("0.00");
- richTextBox1.Text += ((ch1) ? " arctg(x + 3.1) = " + y.ToString("0.00") : "");
- richTextBox1.Text += ((ch2) ? " e^x = " + z.ToString("0.00") : "");
- richTextBox1.Text += ((ch3) ? " 1.5cos(x - п/4*e^x) = " + w.ToString("0.##") : "");
- richTextBox1.Text += Environment.NewLine;
- }
- chart1.Series[0].IsVisibleInLegend = ch1;
- chart1.Series[1].IsVisibleInLegend = ch2;
- chart1.Series[2].IsVisibleInLegend = ch3;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement