예제 #1
0
 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;
 }
예제 #2
0
 static void Main()
 {
     FigureSize figure = new FigureSize(5, 6);
     FigureSize.GetRotatedFigureSize(figure, 90);
 }