Example #1
0
        internal static Matrix CreateTranslation(double offsetX, double offsetY)
        {
            Matrix result = new Matrix();

            result.SetMatrix(1.0, 0.0, 0.0, 1.0, offsetX, offsetY, MatrixTypes.TRANSFORM_IS_TRANSLATION);
            return(result);
        }
Example #2
0
        internal static Matrix CreateScaling(double scaleX, double scaleY)
        {
            Matrix result = new Matrix();

            result.SetMatrix(scaleX, 0.0, 0.0, scaleY, 0.0, 0.0, MatrixTypes.TRANSFORM_IS_SCALING);
            return(result);
        }
Example #3
0
        internal static Matrix CreateRotationRadians(double angle, double centerX, double centerY)
        {
            Matrix result  = new Matrix();
            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;

            result.SetMatrix(num2, num, 0.0 - num, num2, offsetX, offsetY, MatrixTypes.TRANSFORM_IS_UNKNOWN);
            return(result);
        }