Exemplo n.º 1
0
        public static Figure GetRotatedFigure(Figure figure, double rotationAngle)
        {
            var newWidth = Math.Abs(Math.Cos(rotationAngle) * figure.width)
                           + Math.Abs(Math.Sin(rotationAngle) * figure.height);
            var newHeight = Math.Abs(Math.Sin(rotationAngle) * figure.width)
                            + Math.Abs(Math.Cos(rotationAngle) * figure.height);

            return new Figure(newWidth, newHeight);
        }
Exemplo n.º 2
0
        public static Figure GetRotatedSize(Figure figure, double rotationAngle)
        {
            double widthCos = Math.Abs(Math.Cos(rotationAngle)) * figure.Width;
            double heightSin = Math.Abs(Math.Sin(rotationAngle)) * figure.Height;
            double widthSin = Math.Abs(Math.Sin(rotationAngle)) * figure.Width;
            double heightCos = Math.Abs(Math.Cos(rotationAngle)) * figure.Height;

            double width = widthCos + heightSin;
            double height = widthSin + heightCos;

            return new Figure(width, height);
        }