예제 #1
0
 private void ShowPow()
 {
     if (CheckEmptyText(textBox2) && CheckEmptyText(textBox4))
     {
         label1.Text = NewtonCalculations.GetRoot(NewtonCalculations.ff, NewtonCalculations.ffdX, double.Parse(textBox1.Text), double.Parse(textBox2.Text), double.Parse(textBox4.Text)).ToString();
     }
 }
예제 #2
0
 private void ShowHer()
 {
     if (CheckEmptyText(textBox1) && CheckEmptyText(textBox2) && CheckEmptyText(textBox5) && CheckEmptyText(textBox6) && CheckEmptyText(textBox7) && CheckEmptyText(textBox8))
     {
         label1.Text = NewtonCalculations.GetRoot(NewtonCalculations.fff, NewtonCalculations.fffdX, double.Parse(textBox1.Text), double.Parse(textBox2.Text), double.Parse(textBox5.Text), double.Parse(textBox6.Text), double.Parse(textBox7.Text), double.Parse(textBox8.Text)).ToString();
     }
 }
예제 #3
0
        private void CheckCorrectness()
        {
            switch (NowRandomComponent.ToString())
            {
            case "Матрицы":
            {
                switch (NowRandomMatrixFunction.ToString())
                {
                case "Sub":
                {
                    DataGridView CheckDataGrid = new DataGridView();
                    CheckDataGrid.RowCount    = dataGridViews[0].RowCount;
                    CheckDataGrid.ColumnCount = dataGridViews[0].ColumnCount;
                    CheckDataGrid             = MatrixCalculator.MatrixSub(dataGridViews[0], dataGridViews[1], CheckDataGrid);
                    if (CheckIdentityMatrix(CheckDataGrid, dataGridViews[2]))
                    {
                        CorrectCount++;
                    }
                    break;
                }

                case "Mul":
                {
                    DataGridView CheckDataGrid = new DataGridView();
                    CheckDataGrid.RowCount    = dataGridViews[0].RowCount;
                    CheckDataGrid.ColumnCount = dataGridViews[0].ColumnCount;
                    CheckDataGrid             = MatrixCalculator.MatrixMul(dataGridViews[0], dataGridViews[1], CheckDataGrid);
                    if (CheckIdentityMatrix(CheckDataGrid, dataGridViews[2]))
                    {
                        CorrectCount++;
                    }
                    break;
                }
                }
                break;
            }

            case "Уравнения":
            {
                if (EquChecker != 4)
                {
                    if (AnswerText.Text == NewtonCalculations.GetRoot(NewtonCalculations.f, NewtonCalculations.fdX, FirstB, SecondB, koef1).ToString())
                    {
                        CorrectCount++;
                    }
                }
                else
                {
                }
                break;
            }
            }
        }