static void Main(string[] args) { GeometricShapeCalculator.TestIfArrayImplementsICollectionFlorin(); Punct punct = new Punct(); Punct punct2 = new Punct(); punct2.X = 10; Square square = new Square(punct, 10); double shapePerimeter = GeometricShapeCalculator.GetPerimeter(square); ConsoleInteratctiveMenu.ShowPerimeterToConsole(square, shapePerimeter); Segment segment = new Segment(punct, punct2); shapePerimeter = GeometricShapeCalculator.GetPerimeter(segment); Math.Pow(Math.Sqrt(10 - 1), 2); Console.WriteLine("Movement : {0} : (({1}),({2})) ", segment.GetType(), segment.P1.X + "," + segment.P1.Y, segment.P2.X + "," + segment.P2.Y); GeometricShapeCalculator.ShapeMove(segment, 10, 5); Console.WriteLine("by: (10,5) : (({0}),({1})) ", segment.P1.X + "," + segment.P1.Y, segment.P2.X + "," + segment.P2.Y); Console.ReadKey(); }
public static double DistanceBetween2Points(Punct firstPoint, Punct seccondPoint) { return(Math.Abs(Math.Sqrt(Math.Pow(firstPoint.X - seccondPoint.X, 2) + Math.Pow(firstPoint.Y - seccondPoint.Y, 2)))); }