Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // точка вместо запятой в вещественных
- System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
- richTextBox1.Clear();
- chart1.Series[0].Points.Clear();
- chart1.Series[1].Points.Clear();
- double x1, x2, step, foo1, foo2, tmp;
- x1 = Convert.ToDouble(textBox1.Text);
- x2 = Convert.ToDouble(textBox2.Text);
- step = Convert.ToDouble(textBox3.Text);
- for(double x = x1; x <= x2; x+=step)
- {
- tmp = x/3;
- foo1 = tmp*tmp;
- foo2 = Math.Cos(x + Math.PI / 3) + 1.8;
- chart1.Series[0].Points.AddXY(x, foo1);
- chart1.Series[1].Points.AddXY(x, foo2);
- richTextBox1.Text += "x = " + x.ToString("0.000") + "\t"
- + "y(x) = " + foo1.ToString("0.00") + "\t"
- + "z(x) = " + foo2.ToString("0.00") + "\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement