public static void Main()
 {
     Size testFigure = new Size(5.5, 3.7);
     testFigure.GetRotatedSize(testFigure, 90.5);
     Console.WriteLine(testFigure.ToString());
 }
Exemple #2
0
 public static void Main()
 {
     Size testFigure = new Size(5.5, 3.7);
     testFigure.GetRotatedSize(testFigure, 90.5);
     Console.WriteLine(testFigure.ToString());
 }
Exemple #3
0
        //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;
        }