static void Main(string[] args)
 {
     Point p1 = new Point(1, 2);
     Point p2 = new Point(5, 1);
     Point p3 = new Point(3, 5);
     Point p4 = new Point(1, 5);
     Triangle triangle = new Triangle(p1, p2, p3);
     //Console.WriteLine(triangle.GetArea());
     //Console.WriteLine(triangle.GetPerimeter());
     Console.WriteLine(triangle.ToString());
     Ellipse ellipse = new Ellipse(5, 10);
     //Console.WriteLine(ellipse.GetPerimeter());
     //Console.WriteLine(ellipse.GetArea());
     Console.WriteLine(ellipse.ToString());
     Rectangle rectangle = new Rectangle(p1,p2,p3,p4);
     //Console.WriteLine(rectangle.Width);
     //Console.WriteLine(rectangle.Heigth);
     //Console.WriteLine(rectangle.GetArea());
     //Console.WriteLine(rectangle.GetPerimeter());
     Console.WriteLine(rectangle.ToString());
 }
Example #2
0
        static void Main(string[] args)
        {
            Random random = new Random();
            int    rand   = random.Next(1, 3);

            Drawer figure = new FigureDrawer();

            figure.Draw(rand);

            Figure figure1 = new Circle(0, 0, 10);

            Console.WriteLine(figure1.ToString());

            Figure figure2 = new Rectangle(0, 0, 0, 5, 5, 5, 0, 5);

            Console.WriteLine(figure2.ToString());

            Figure figure3 = new Triangle(0, 0, 3, 3, 0, 6);

            Console.WriteLine(figure3.ToString());

            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            Point    p1       = new Point(1, 2);
            Point    p2       = new Point(5, 1);
            Point    p3       = new Point(3, 5);
            Point    p4       = new Point(1, 5);
            Triangle triangle = new Triangle(p1, p2, p3);

            //Console.WriteLine(triangle.GetArea());
            //Console.WriteLine(triangle.GetPerimeter());
            Console.WriteLine(triangle.ToString());
            Ellipse ellipse = new Ellipse(5, 10);

            //Console.WriteLine(ellipse.GetPerimeter());
            //Console.WriteLine(ellipse.GetArea());
            Console.WriteLine(ellipse.ToString());
            Rectangle rectangle = new Rectangle(p1, p2, p3, p4);

            //Console.WriteLine(rectangle.Width);
            //Console.WriteLine(rectangle.Heigth);
            //Console.WriteLine(rectangle.GetArea());
            //Console.WriteLine(rectangle.GetPerimeter());
            Console.WriteLine(rectangle.ToString());
        }
Example #4
0
 private void button2_Click(object sender, EventArgs e)
 {
     richTextBox1.Text = Tri.ToString();
 }