Example #1
0
    public static FigureSize GetRotatedSize(FigureSize size, double figureAngle)
    {
        double width = (Math.Abs(Math.Cos(figureAngle)) * size.width) + (Math.Abs(Math.Sin(figureAngle)) * size.heigth);
        double heigth = (Math.Abs(Math.Sin(figureAngle)) * size.width) + (Math.Abs(Math.Cos(figureAngle)) * size.heigth);

        return new FigureSize(width, heigth);
    }
Example #2
0
 static void Main()
 {
     FigureSize someFigure = new FigureSize(3.45, 24.5);
     // Before rotation
     Console.WriteLine(someFigure.ToString());
     // Rotate
     someFigure = FigureSize.GetRotatedSize(someFigure, 7);
     // After rotation
     Console.WriteLine(someFigure.ToString());
 }
Example #3
0
 public static FigureSize GetRotatedSize(FigureSize figure,
     double rotatedFigAngle)
 {
     FigureSize RotatedFigure = new FigureSize(
         Math.Abs(Math.Cos(rotatedFigAngle)) * figure.Width +
         Math.Abs(Math.Sin(rotatedFigAngle)) * figure.Heigth,
         Math.Abs(Math.Sin(rotatedFigAngle)) * figure.Width +
         Math.Abs(Math.Cos(rotatedFigAngle)) * figure.Heigth);
     return RotatedFigure;
 }