public static FigureSize GetRotatedFigureSize(FigureSize dimensionsOfFigure, double angleOfRotation) { double rotatedWidth = Math.Abs(Math.Cos(angleOfRotation)) * dimensionsOfFigure.Width + Math.Abs(Math.Sin(angleOfRotation)) * dimensionsOfFigure.Height; double rotatedHeight = Math.Abs(Math.Sin(angleOfRotation)) * dimensionsOfFigure.Width + Math.Abs(Math.Cos(angleOfRotation)) * dimensionsOfFigure.Height; FigureSize rotatedFigureSize = new FigureSize(rotatedWidth, rotatedHeight); return rotatedFigureSize; }
static void Main() { FigureSize figure = new FigureSize(5, 6); FigureSize.GetRotatedFigureSize(figure, 90); }