Ejemplo n.º 1
0
        private void Plot_Click(object sender, EventArgs e)
        {
            try
            {
                ErrorChecking();

                SovleGraph graph = new SovleGraph(TextBoxes, Grapths, X_min, X_max);

                graph.CreateGraphics();
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Ошибка: {ex.Message}");
            }
        }
Ejemplo n.º 2
0
        private void WriteInTable(List <Complex> matrix)
        {
            SovleGraph Equation = new SovleGraph(TextBoxes, Grapths, X_min, X_max);

            dataGridView1.Rows.Clear();

            double xMax = 0;

            for (int i = 0; i < matrix.Count; i++)
            {
                dataGridView1.Rows.Add();

                if (matrix[i].Imaginary == 0)
                {
                    dataGridView1[0, i].Value = $"x_{i + 1} = {matrix[i].Real:0.#####}";
                    dataGridView1[1, i].Value = $"f(x{i+1}) = {Equation.DegreeEquation(matrix[i]).Real:0.#####}";

                    if (i == 0)
                    {
                        xMax = matrix[i].Real;
                    }
                    else
                    {
                        if (matrix[i].Real > xMax)
                        {
                            xMax = matrix[i].Real;
                        }
                    }
                }
                else
                {
                    dataGridView1[0, i].Value = $"x_{i + 1} = {matrix[i].Real:0.#####} + ({matrix[i].Imaginary:0.#####})*i";
                    dataGridView1[1, i].Value = $"f(x{ i + 1}) = {Equation.DegreeEquation(matrix[i])}";
                }
            }

            X_min.Text = Convert.ToString(xMax - 2.0);
            X_max.Text = Convert.ToString(xMax + 2.0);
        }