﻿using System;

namespace ClassSizeInCSharp
{
    public class Rectangle
    {
        private double width;
        private double height;

        public Rectangle(double width, double height)
        {
            this.width = width;
            this.height = height;
        }

        public static Rectangle GetRotatedSize(Rectangle rectangle, double angleOfRotation)
        {
            var angleOfRotationCos = Math.Abs(Math.Cos(angleOfRotation));
            var angleOfRotationSin = Math.Abs(Math.Sin(angleOfRotation));

            var width = (angleOfRotationSin * rectangle.width) + (angleOfRotationCos * rectangle.height);
            var height = (angleOfRotationCos * rectangle.width) + (angleOfRotationSin * rectangle.height);

            var rotatedRectangle = new Rectangle(width, height);

            return rotatedRectangle;
        }
    }
}