예제 #1
0
파일: Program.cs 프로젝트: Laetar/WhatATask
 private static void WriteFigure()
 {
     Console.WriteLine("---------------------------------------");
     if (!Line.IsNull())
     {
         Console.WriteLine("Параметры линии: ");
         Console.WriteLine("Координаты точек A и B: A({0},{1}),B({2},{3})", Line.x1, Line.y1, Line.x2, Line.y2);
         Console.WriteLine("Длинна отрезка AB: {0}", Math.Round(Line.Length()));
         Console.WriteLine();
     }
     if (!Round.IsNull())
     {
         Console.WriteLine("Параметры круга: ");
         Console.WriteLine("Координата центра круга: ({0},{1}), Радиус круга {2}", Round.X, Round.Y, Round.Radius);
         Console.WriteLine("Площадь круга: {0}", Math.Round(Round.Area()));
         Console.WriteLine("Периметр круга: {0}", Math.Round(Round.Length()));
         Console.WriteLine();
     }
     if (!Ring.IsNull())
     {
         Console.WriteLine("Параметры кольца: ");
         Console.WriteLine("Координата центра кольца: ({0},{1})", Ring.inRound.X, Ring.inRound.Y);
         Console.WriteLine("Радиус внешнего круга: {0}, Радиус внутреннего круга: {1}", Ring.outRound.Radius, Ring.inRound.Radius);
         Console.WriteLine("Площадь кольца: {0}", Math.Round(Ring.Area()));
         Console.WriteLine("Периметр кольца: {0}", Math.Round(Ring.SumLength()));
         Console.WriteLine();
     }
     if (!Rectangle.IsNull())
     {
         Console.WriteLine("Параметры прямоугольника: ");
         Console.WriteLine("Координаты угловых точек прямоугольника: A({0},{1}),B({2},{3})", Rectangle.x1, Rectangle.y1, Rectangle.x2, Rectangle.y2);
         Console.WriteLine("Периметр прямоугольника: {0}", Rectangle.Length());
         Console.WriteLine("Площадь прямоугольника: {0}", Rectangle.Area());
         Console.WriteLine();
     }
     Console.ReadKey();
 }
예제 #2
0
 public double Area()
 {
     return(outRound.Area() - inRound.Area());
 }