private void button2_Click(object sender, EventArgs e) { int N = Convert.ToInt32(textBox4.Text); int Nk = Convert.ToInt32(textBox3.Text); int t = 1; if (radioButton1.Checked == true) { t = 1; } if (radioButton2.Checked == true) { t = 2; } Task2 T = new Task2(N, Nk, t); if (checkBox4.Checked == false) { AddTable1(dataGridView3, N + 1, T); AddTable2(dataGridView4, Nk + 1, T); } label8.Text = "maxR = " + Convert.ToString(T.maxR) + " при х = " + Convert.ToString(T.maxRx); label7.Text = "maxRp = " + Convert.ToString(T.maxRp) + " при х = " + Convert.ToString(T.maxRpx); label6.Text = "maxRpp = " + Convert.ToString(T.maxRpp) + " при х = " + Convert.ToString(T.maxRppx); if (checkBox3.Checked == false) { AddGraph2(zedGraphControl6, Nk + 1, T.xk, T.f, T.S, "f(x)", "S(x)"); AddGraph1(zedGraphControl7, Nk + 1, T.xk, T.R, "R(x)"); AddGraph2(zedGraphControl8, Nk + 1, T.xk, T.fp, T.Sp, "f'(x)", "S'(x)"); AddGraph1(zedGraphControl9, Nk + 1, T.xk, T.Rp, "R'(x)"); AddGraph2(zedGraphControl10, Nk + 1, T.xk, T.fpp, T.Spp, "f''(x)", "S''(x)"); } }
private void button1_Click(object sender, EventArgs e) { int n = Convert.ToInt32(textBox1.Text); int k = Convert.ToInt32(textBox2.Text); if (radioButton1.Checked) { Task t = new Task1(n, k * n); Task tt = new Task1(200, 600); t.addSplineDGV(dataGridView1); t.addResSplineDGV(dataGridView2); tt.addFSGraph(zedGraphControl1); t.addFpSpGraph(zedGraphControl2); t.addFppSppGraph(zedGraphControl3); t.addRGraph(zedGraphControl4); t.addRpGraph(zedGraphControl5); t.addRppGraph(zedGraphControl6); label2.Text = Convert.ToString(n); label4.Text = Convert.ToString(k * n); label6.Text = Convert.ToString(t.maxr); label8.Text = Convert.ToString(t.maxrx); label11.Text = Convert.ToString(t.maxrp); label15.Text = Convert.ToString(t.maxrpx); label12.Text = Convert.ToString(t.maxrpp); label16.Text = Convert.ToString(t.maxrppx); } if (radioButton2.Checked) { Task t = new Task2(n, k * n, radioButton7.Checked); Task tt = new Task2(200, 600, radioButton7.Checked); t.addSplineDGV(dataGridView1); t.addResSplineDGV(dataGridView2); tt.addFSGraph(zedGraphControl1); t.addFpSpGraph(zedGraphControl2); t.addFppSppGraph(zedGraphControl3); t.addRGraph(zedGraphControl4); t.addRpGraph(zedGraphControl5); t.addRppGraph(zedGraphControl6); label2.Text = Convert.ToString(n); label4.Text = Convert.ToString(k * n); label6.Text = Convert.ToString(t.maxr); label8.Text = Convert.ToString(t.maxrx); label11.Text = Convert.ToString(t.maxrp); label15.Text = Convert.ToString(t.maxrpx); label12.Text = Convert.ToString(t.maxrpp); label16.Text = Convert.ToString(t.maxrppx); } if (radioButton3.Checked) { Task t = new Task3(n, k * n, radioButton7.Checked); Task tt = new Task3(200, 600, radioButton7.Checked); t.addSplineDGV(dataGridView1); t.addResSplineDGV(dataGridView2); tt.addFSGraph(zedGraphControl1); t.addFpSpGraph(zedGraphControl2); t.addFppSppGraph(zedGraphControl3); t.addRGraph(zedGraphControl4); t.addRpGraph(zedGraphControl5); t.addRppGraph(zedGraphControl6); label2.Text = Convert.ToString(n); label4.Text = Convert.ToString(k * n); label6.Text = Convert.ToString(t.maxr); label8.Text = Convert.ToString(t.maxrx); label11.Text = Convert.ToString(t.maxrp); label15.Text = Convert.ToString(t.maxrpx); label12.Text = Convert.ToString(t.maxrpp); label16.Text = Convert.ToString(t.maxrppx); } if (radioButton4.Checked) { Task t = new Task4(n, k * n, radioButton7.Checked); Task tt = new Task4(200, 600, radioButton7.Checked); t.addSplineDGV(dataGridView1); t.addResSplineDGV(dataGridView2); tt.addFSGraph(zedGraphControl1); t.addFpSpGraph(zedGraphControl2); t.addFppSppGraph(zedGraphControl3); t.addRGraph(zedGraphControl4); t.addRpGraph(zedGraphControl5); t.addRppGraph(zedGraphControl6); label2.Text = Convert.ToString(n); label4.Text = Convert.ToString(k * n); label6.Text = Convert.ToString(t.maxr); label8.Text = Convert.ToString(t.maxrx); label11.Text = Convert.ToString(t.maxrp); label15.Text = Convert.ToString(t.maxrpx); label12.Text = Convert.ToString(t.maxrpp); label16.Text = Convert.ToString(t.maxrppx); } }