public static void Main() { Size testFigure = new Size(5.5, 3.7); testFigure.GetRotatedSize(testFigure, 90.5); Console.WriteLine(testFigure.ToString()); }
//methods public Size GetRotatedSize(Size figureSize, double rotatedFigureAngle) { WidthAfterRotation = Math.Abs(Math.Cos(rotatedFigureAngle)) * figureSize.Width + Math.Abs(Math.Sin(rotatedFigureAngle)) * figureSize.Height; HeightAfterRotation = Math.Abs(Math.Sin(rotatedFigureAngle)) * figureSize.Width + Math.Abs(Math.Cos(rotatedFigureAngle)) * figureSize.Height; figureSize = new Size(WidthAfterRotation, HeightAfterRotation); return figureSize; }