Beispiel #1
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (numA.Value < numB.Value)
            {
                if (listBox1.SelectedIndex == 0)
                {
                    MidpointMethod s = new MidpointMethod((double)numA.Value, (double)numB.Value, (double)numQ.Value);

                    gr = new Graph(this, (double)numA.Value, (double)numB.Value, (double)numQ.Value, s);
                    gr.Show();
                }
                if (listBox1.SelectedIndex == 1)
                {
                    SimpsonsMethod s = new SimpsonsMethod((double)numA.Value, (double)numB.Value, (double)numQ.Value);
                    gr = new Graph(this, (double)numA.Value, (double)numB.Value, (double)numQ.Value, s);
                    gr.Show();
                }
                if (listBox1.SelectedIndex == 2)
                {
                    MonteCarloMethod s = new MonteCarloMethod((double)numA.Value, (double)numB.Value, (double)numQ.Value);
                    gr = new Graph(this, (double)numA.Value, (double)numB.Value, (double)numQ.Value, s);
                    gr.Show();
                }
            }
            else
            {
                label2.Text = "ErRoR";
            }
        }
Beispiel #2
0
 public Graph(Get_Data f, double a, double b, double quantity, MidpointMethod d)
 {
     this.a           = a;
     this.b           = b;
     this.quantity    = (int)quantity;
     interval         = (b - a) / this.quantity;
     d.EventColumn   += OnColumn;
     d.EventProgress += OnProgress;
     d.EventFinish   += OnFinish;
     d.EventTime     += OnTime;
     this.d           = d;
     //d.Start();
     f.Hide();
     g = f;
     InitializeComponent();
 }