Ejemplo n.º 1
0
        private void calulateBtn_Click(object sender, EventArgs e)
        {
            var a = Convert.ToInt32(ValueATb.Text);

            var b = Convert.ToInt32(ValueBTb.Text);

            var c = Convert.ToInt32(ValueCTb.Text);

            var x  = -(a * a / c);
            var x1 = (a * a / c);

            var hyperbola = new Hyperbola(a, b, c);

            var y1 = hyperbola.Evaluate(x);
            var y2 = hyperbola.Evaluate(x1);

            hyperbolaDataGrid.Rows.Add(1);
            hyperbolaDataGrid.Rows[_resultCount].Cells[0].Value = $"{_resultCount}";
            hyperbolaDataGrid[1, _resultCount].Value            = a;
            hyperbolaDataGrid[2, _resultCount].Value            = b;
            hyperbolaDataGrid[3, _resultCount].Value            = c;
            hyperbolaDataGrid[4, _resultCount].Value            = x;
            hyperbolaDataGrid[5, _resultCount].Value            = y1;
            _resultCount++;

            hyperbolaDataGrid.Rows.Add(1);
            hyperbolaDataGrid.Rows[_resultCount].Cells[0].Value = $"{_resultCount}";
            hyperbolaDataGrid[1, _resultCount].Value            = a;
            hyperbolaDataGrid[2, _resultCount].Value            = b;
            hyperbolaDataGrid[3, _resultCount].Value            = c;
            hyperbolaDataGrid[4, _resultCount].Value            = x1;
            hyperbolaDataGrid[5, _resultCount].Value            = y2;
            _resultCount++;
        }
Ejemplo n.º 2
0
        public static void Task13()
        {
            WriteLine("Enter x");
            double      x  = Convert.ToDouble(ReadLine());
            CubePolinom cb = new CubePolinom();
            Hyperbola   hb = new Hyperbola();

            WriteLine("Cube Polinom: " + cb.Calc(x));
            WriteLine("Hyperbola: " + hb.Calc(x));
        }
Ejemplo n.º 3
0
 private void button3_Click(object sender, EventArgs e)
 {
     try
     {
         double    x    = Convert.ToDouble(textBox3.Text);
         Hyperbola func = new Hyperbola(Convert.ToInt32(textBox7.Text));
         label9.Text = "значение функции Hyperbola для x = " + Convert.ToString(x) +
                       " равно " + Convert.ToString(func.Count(x));
     }
     catch
     {
         label9.Text = "Ошибка ввода";
     }
 }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            #region Figure
            //BaseFigure[] figures = new BaseFigure[5];

            //figures[0] = new Triangle("isosceles", 8.0, 12.0, 5.0);

            //figures[1] = new Rectangle(10.0);

            //figures[2] = new Rectangle(10.0, 4.0);

            //figures[3] = new Triangle(7.0);

            //figures[4] = new Circle(4.0);

            //for (int i = 0; i < figures.Length; i++)
            //{

            //    Console.WriteLine("Object — " + figures[i].name);

            //    Console.WriteLine("Area = " + figures[i].Area());

            //    Console.WriteLine("Perimetr = " + figures[i].Perimetr());

            //    figures[i].ShowDim();

            //    Console.WriteLine();
            //}
            #endregion

            #region Function
            BaseFunction[] func = new BaseFunction[3];

            func[0] = new DerivedLine(8.0, 12.0);

            func[1] = new DerivedKub(8.00, 10.0, 5.0);

            func[2] = new Hyperbola(4.0);


            for (int i = 0; i < func.Length; i++)
            {
                func[i].Show();

                Console.WriteLine();
            }
            #endregion

            Console.ReadKey();
        }