Пример #1
0
        public Point <T> Rotate(Angle angle, T centerX, T centerY)
        {
            var dx = _arithmetic.ToDouble(_arithmetic.Subtract(X, centerX));
            var dy = _arithmetic.ToDouble(_arithmetic.Subtract(Y, centerY));

            var cos = Math.Cos(angle.Radians);
            var sin = Math.Sin(angle.Radians);

            var x = _arithmetic.FromDouble(cos * dx - sin * dy + _arithmetic.ToDouble(centerX));
            var y = _arithmetic.FromDouble(sin * dx + cos * dy + _arithmetic.ToDouble(centerY));

            return(new Point <T>(x, y));
        }