public static Size GetRotatedSize(Size figure, double rotationAngle) { double newWidth = Math.Abs(Math.Cos(rotationAngle)) * figure.Width; double newHeight = Math.Abs(Math.Sin(rotationAngle)) * figure.Height; Size newFigure = new Size(newWidth + newHeight, newWidth + newHeight); return newFigure; }
private static void Main() { // Testing Task 1: Size car = new Size(2.34, 4.65); Size car2 = Size.GetRotatedSize(car, 90.1); Console.WriteLine(car); Console.WriteLine(car2); // Testing Task 2: double[] digits = new double[] { 22.2, 2, 22, 3, 4, 5, 6, 7, 1, 8 }; Console.WriteLine("Average: " + Statistics.GetAvg(digits, digits.Length)); Console.WriteLine("Min: " + Statistics.GetMin(digits, digits.Length)); Console.WriteLine("Max: " + Statistics.GetMax(digits, digits.Length)); }