public static Size GetRotatedSize(Size figure, double angleOfRotation) { double rotationWidth = (Math.Abs(Math.Cos(angleOfRotation)) * figure.width) + (Math.Abs(Math.Sin(angleOfRotation)) * figure.height); double rotationHeight = (Math.Abs(Math.Sin(angleOfRotation)) * figure.width) + (Math.Abs(Math.Cos(angleOfRotation)) * figure.height); Size resultSize = new Size(rotationWidth, rotationHeight); return resultSize; }
public static Size GetRotatedSize(Size size, double angleOfTheFigureThatWillBeRotaed) { double newWidth = (Math.Abs(Math.Cos(angleOfTheFigureThatWillBeRotaed)) * size.Width) + (Math.Abs(Math.Sin(angleOfTheFigureThatWillBeRotaed)) * size.Height); double newHeight = (Math.Abs(Math.Sin(angleOfTheFigureThatWillBeRotaed)) * size.Width) + (Math.Abs(Math.Cos(angleOfTheFigureThatWillBeRotaed)) * size.Height); Size newSize = new Size(newWidth, newHeight); return newSize; }