Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- double xmin = double.Parse(textBox1.Text);
- double xmax = double.Parse(textBox2.Text);
- double step = double.Parse(textBox3.Text);
- int count = (int)Math.Ceiling((xmax - xmin) / step) + 1;
- double[] x = new double[count];
- double[] y1 = new double[count];
- double[] y2 = new double[count];
- for (int i = 0; i < count; i++)
- {
- x[i] = xmin + step * i;
- y1[i] = Math.Pow(x[i], 4) + Math.Cos(2 + Math.Pow(x[i], 3) - 1.3);
- y2[i] = Math.Sqrt(Math.Pow(x[i], 4) + Math.Cos(2 + Math.Pow(x[i], 3) - 1.3));
- }
- chart1.ChartAreas[0].AxisX.Minimum = xmin;
- chart1.ChartAreas[0].AxisX.Maximum = xmax;
- chart1.ChartAreas[0].AxisX.MajorGrid.Interval = step;
- chart1.Series[0].Points.DataBindXY(x, y1);
- chart1.Series[1].Points.DataBindXY(x, y2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement