Ejemplo n.º 1
0
        private void DrawDerivativeNeuton()
        {
            var myModel = new PlotModel {
                Title = tree.ReadDerivative()
            };
            FunctionSeries series = new FunctionSeries();

            for (double i = -100; i < 100; i++)
            {
                double y = tree.DerivativeNeuton(i);
                series.Points.Add(new DataPoint(i, y));
            }

            myModel.Series.Add(series);
            this.plot1.Model = myModel;
        }
Ejemplo n.º 2
0
 private void btnParseDerivative_Click(object sender, EventArgs e)
 {
     try
     {
         string v = tbxFormula.Text;
         if (rbtnPrefix.Checked)
         {
             if (v != "")
             {
                 treeDerA         = treeDerA.Create(v);
                 lblFunction.Text = treeDerA.ReadDerivative();
             }
             else
             {
                 MessageBox.Show("Please, write a valid formula!");
             }
         }
         else
         {
             MessageBox.Show("Please, select the radio button!");
         }
     }
     catch (StackOverflowException)
     {
     }
     catch (MyException m)
     {
         MessageBox.Show(m.Message);
     }
 }