Пример #1
0
        public static void Main()
        {
            Figure a = new Figure(5, 3);
            a = a.GetRotatedSize(15);

            Console.WriteLine(a.Width);
            Console.WriteLine(a.Height);
        }
Пример #2
0
        public Figure GetRotatedSize(double angleOfFigureRotation)
        {
            double angleCos = Math.Cos(angleOfFigureRotation);
            double angleSin = Math.Sin(angleOfFigureRotation);

            double resultSizeWidth = (Math.Abs(angleCos) * this.Width) + (Math.Abs(angleSin) * this.Height);
            double resultSizeHeight = (Math.Abs(angleSin) * this.Width) + (Math.Abs(angleCos) * this.Height);

            Figure result = new Figure(resultSizeWidth, resultSizeHeight);

            return result;
        }