Ejemplo n.º 1
0
        public Size GetRotatedSize(double rotationAngle)
        {
            double widthAfterRotation = GetRotatedDimensions(rotationAngle, this.Width, this.Height);
            double heightAfterRotation = GetRotatedDimensions(rotationAngle, this.Height, this.Width);
            Size result = new Size(widthAfterRotation, heightAfterRotation);

            return result;
        }
        public static void Main()
        {
            var figure = new Size(4.4, 7.2);
            var sizeAfterRotation = figure.GetRotatedSize(55.2);

            Console.WriteLine("Initial size:\n width : {0}\n height : {1}", figure.Width, figure.Height);
            Console.WriteLine("Size after rotation:\n width : {0}\n height : {1}", sizeAfterRotation.Width, sizeAfterRotation.Height);
        }