Esempio n. 1
0
 public void MatrWrite()
 {
     for (int i = 0; i < this.NRow; i++)
     {
         for (int j = 0; j < this.nCol; j++)
         {
             this.matr.A[i, j].FractTxt = MyFuncs.convertToFract(this.txtBxs[i, j].Text);
         }
     }
 }
Esempio n. 2
0
 private void SobstChisla_Click(object sender, RoutedEventArgs e)
 {
     myM1.MatrWrite();
     myM2.MatrWrite();
     try
     {
         //SystUrav s = new SystUrav(m1.MyMatrToQuadMatr(), m2.MyMatrToMatr());
         QuadMatr x  = myM1.matr.toQuadMatr();
         Fraction fr = new Fraction();
         fr.FractTxt = MyFuncs.convertToFract(lambda.Text);
         Matr lbd = x.InverseIterMetod(fr, myM2.MyMatrToMatr());
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 3
0
        private void SystUr_simple_Click(object sender, RoutedEventArgs e)
        {
            myM1.MatrWrite();
            myM2.MatrWrite();
            try
            {
                SystUrav s  = new SystUrav(myM1.matr.toQuadMatr(), myM2.matr);
                Fraction ep = new Fraction();
                ep.FractTxt = MyFuncs.convertToFract(eps.Text);
                Matr m = s.SimpleIterRoots(ep, int.Parse(SimpleIterTxt.Text));
                RezWnd          = new RezWindow();
                RezWnd.Owner    = this;
                RezWnd.Title    = "Корни системы уравнений";
                myMRez          = new MyMatr(ref RezWnd.MatrRezGrid, ref m, 5);
                myMRez.isDouble = (bool)isDbl.IsChecked;
                myMRez.Redraw();
                RezWnd.btnCopyTo1.Visibility = Visibility.Hidden;
                RezWnd.btnCopyTo2.Visibility = Visibility.Hidden;
                TextBox[,] b       = myMRez.GetMatrBx();
                b[0, 0].Text       = "корни";
                b[0, 0].FontWeight = FontWeights.Bold;
                b[0, 1].Text       = "" + '\x03B4';
                b[0, 1].FontWeight = FontWeights.Bold;
                b[0, 2].Text       = '\x03B4' + "(" + m.A[0, 2].FractTxt + ")";
                b[0, 2].FontWeight = FontWeights.Bold;
                //for (int i = 1; i < mRez.NRow; i++)
                //{
                //    if (b[i, 2].Text == "1")
                //    {
                //        b[i, 2].Text = "верно";
                //    }
                //    else
                //    {
                //        b[i, 2].Text = "неверно";
                //    }

                //}

                RezWnd.ShowDialog();
                myMRez = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 4
0
        private void btnLagr_Click(object sender, RoutedEventArgs e)
        {
            if (tabl.isRavnom())
            {
                tabl.GetTablKonRazn();
            }
            else
            {
                tabl.GetTablRazdelRazn();
            }
            txtPolynom.Text = "";
            txtPolynom.Text = tabl.GetPolyLagrange();
            Fraction fr = new Fraction();

            fr.FractTxt     = MyFuncs.convertToFract(valPoly.Text);
            txtPolynom.Text = txtPolynom.Text + "=" + tabl.GetPolyLagrangeVal(fr).FractTxt;
        }
Esempio n. 5
0
        private void btnTrapForm_Click(object sender, RoutedEventArgs e)
        {
            if (tabl.isRavnom())
            {
                tabl.GetTablKonRazn();
            }
            else
            {
                tabl.GetTablRazdelRazn();
            }
            Fraction a  = new Fraction();
            Fraction b  = new Fraction();
            Fraction fr = new Fraction();

            fr.FractTxt = MyFuncs.convertToFract(valPoly.Text);
            a.FractTxt  = MyFuncs.convertToFract(val_a.Text);
            b.FractTxt  = MyFuncs.convertToFract(val_b.Text);
            GrdGraf.Children.Clear();
            tabl.DrawIntegr(ref GrdGraf, a, b, int.Parse(numInt.Text));
            tabl.DrawPolynom(ref GrdGraf, tabl.NCol - 2, fr, 1, 50);
            MessageBox.Show("Интеграл равен: " + tabl.GetTrapForm(a, b, int.Parse(numInt.Text)).ToDouble());
        }
Esempio n. 6
0
 private void btnNewton_Click(object sender, RoutedEventArgs e)
 {
     if (tabl.isValid())
     {
         if (tabl.isRavnom())
         {
             tabl.GetTablKonRazn();
         }
         else
         {
             tabl.GetTablRazdelRazn();
         }
         txtPolynom.Text = "";
         Fraction fr = new Fraction();
         fr.FractTxt     = MyFuncs.convertToFract(valPoly.Text);
         txtPolynom.Text = tabl.GetPolyNewton(int.Parse(Poryadok.Text), int.Parse(tblIspRow.Text)) + "=" + tabl.GetPolyNewtonVal(fr, int.Parse(Poryadok.Text), int.Parse(tblIspRow.Text)).FractTxt;
         GrdGraf.Children.Clear();
         tabl.DrawPolynom(ref GrdGraf, int.Parse(Poryadok.Text), fr, int.Parse(tblIspRow.Text), 50);
     }
     else
     {
         MessageBox.Show("Заполните все значения X и Y!");
     }
 }