Пример #1
0
        static MatrixMock CreateIdentity()
        {
            MatrixMock mock = new MatrixMock();

            mock.SetMatrix(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, MatrixTypesMock.TRANSFORM_IS_IDENTITY);
            return(mock);
        }
Пример #2
0
        internal static MatrixMock CreateTranslation(double offsetX, double offsetY)
        {
            MatrixMock mock = new MatrixMock();

            mock.SetMatrix(1.0, 0.0, 0.0, 1.0, offsetX, offsetY, MatrixTypesMock.TRANSFORM_IS_TRANSLATION);
            return(mock);
        }
Пример #3
0
        internal static MatrixMock CreateSkewRadians(double skewX, double skewY)
        {
            MatrixMock mock = new MatrixMock();

            mock.SetMatrix(1.0, Math.Tan(skewY), Math.Tan(skewX), 1.0, 0.0, 0.0, MatrixTypesMock.TRANSFORM_IS_UNKNOWN);
            return(mock);
        }
Пример #4
0
        internal static MatrixMock CreateScaling(double scaleX, double scaleY)
        {
            MatrixMock mock = new MatrixMock();

            mock.SetMatrix(scaleX, 0.0, 0.0, scaleY, 0.0, 0.0, MatrixTypesMock.TRANSFORM_IS_SCALING);
            return(mock);
        }
Пример #5
0
        internal static MatrixMock CreateScaling(double scaleX, double scaleY, double centerX, double centerY)
        {
            MatrixMock mock = new MatrixMock();

            mock.SetMatrix(scaleX, 0.0, 0.0, scaleY, centerX - (scaleX * centerX), centerY - (scaleY * centerY), MatrixTypesMock.TRANSFORM_IS_SCALING | MatrixTypesMock.TRANSFORM_IS_TRANSLATION);
            return(mock);
        }
Пример #6
0
        internal static MatrixMock CreateRotationRadians(double angle, double centerX, double centerY)
        {
            MatrixMock mock    = new MatrixMock();
            double     num     = Math.Sin(angle);
            double     num2    = Math.Cos(angle);
            double     offsetX = (centerX * (1.0 - num2)) + (centerY * num);
            double     offsetY = (centerY * (1.0 - num2)) - (centerX * num);

            mock.SetMatrix(num2, num, -num, num2, offsetX, offsetY, MatrixTypesMock.TRANSFORM_IS_UNKNOWN);
            return(mock);
        }