Create() public static method

Creates a new identity matrix
public static Create ( ) : IMatrix
return IMatrix
Exemplo n.º 1
0
        /// <summary>
        /// Creates a new matrix with a skew
        /// </summary>
        /// <returns>A new skew matrix</returns>
        /// <param name="skewX">Amount to skew along the X axis, 1.0 does not skew</param>
        /// <param name="skewY">Amount to skew along the Y axis, 1.0 does not skew</param>
        public static IMatrix FromSkew(float skewX, float skewY)
        {
            var matrix = Matrix.Create();

            matrix.Skew(skewX, skewY);
            return(matrix);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new rotation matrix
        /// </summary>
        /// <returns>A new rotation matrix</returns>
        /// <param name="angle">Angle in degrees to rotate. A positive value indicates a clockwise rotation, whereas a negative value will rotate counter clockwise</param>
        public static IMatrix FromRotation(float angle)
        {
            var matrix = Matrix.Create();

            matrix.Rotate(angle);
            return(matrix);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates a new rotation matrix around a (<paramref name="centerX"/>, <paramref name="centerY"/>) point with the specified <paramref name="angle"/>
        /// </summary>
        /// <returns>A new rotation matrix</returns>
        /// <param name="angle">Angle in degrees to rotate. A positive value indicates a clockwise rotation, whereas a negative value will rotate counter clockwise</param>
        /// <param name="centerX">X co-ordinate of the point to rotate around</param>
        /// <param name="centerY">Y co-ordinate of the point to rotate around</param>
        public static IMatrix FromRotationAt(float angle, float centerX, float centerY)
        {
            var matrix = Matrix.Create();

            matrix.RotateAt(angle, centerX, centerY);
            return(matrix);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Creates a new matrix with a scale at the specified point
        /// </summary>
        /// <returns>A new matrix with a scale transform</returns>
        /// <param name="scaleX">The amount to multiply coordinates along the x axis</param>
        /// <param name="scaleY">The amount to multiply coordinates along the y axis</param>
        /// <param name="centerX">X co-ordinate of the point to scale from</param>
        /// <param name="centerY">Y co-ordinate of the point to scale from</param>
        public static IMatrix FromScaleAt(float scaleX, float scaleY, float centerX, float centerY)
        {
            var matrix = Matrix.Create();

            matrix.ScaleAt(scaleX, scaleY, centerX, centerY);
            return(matrix);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Creates a new matrix with a translation
        /// </summary>
        /// <returns>A new translation matrix</returns>
        /// <param name="distanceX">Distance to translate along the x axis</param>
        /// <param name="distanceY">Distance to translate along the y axis</param>
        public static IMatrix FromTranslation(float distanceX, float distanceY)
        {
            var matrix = Matrix.Create();

            matrix.Translate(distanceX, distanceY);
            return(matrix);
        }
Exemplo n.º 6
0
        public static IMatrix FromSkew(float skewX, float skewY, Generator generator)
        {
            var matrix = Matrix.Create(generator);

            matrix.Skew(skewX, skewY);
            return(matrix);
        }
Exemplo n.º 7
0
        public static IMatrix FromRotation(float angle, Generator generator)
        {
            var matrix = Matrix.Create(generator);

            matrix.Rotate(angle);
            return(matrix);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Creates a new rotation matrix around a (<paramref name="centerX"/>, <paramref name="centerY"/>) point with the specified <paramref name="angle"/>
        /// </summary>
        /// <returns>A new rotation matrix</returns>
        /// <param name="angle">Angle in degrees to rotate. A positive value indicates a clockwise rotation, whereas a negative value will rotate counter clockwise</param>
        /// <param name="centerX">X co-ordinate of the point to rotate around</param>
        /// <param name="centerY">Y co-ordinate of the point to rotate around</param>
        /// <param name="generator">Generator to create the matrix</param>
        public static IMatrix FromRotationAt(float angle, float centerX, float centerY, Generator generator = null)
        {
            var matrix = Matrix.Create(generator);

            matrix.RotateAt(angle, centerX, centerY);
            return(matrix);
        }
Exemplo n.º 9
0
        /// <summary>
        /// Creates a new matrix with a translation
        /// </summary>
        /// <returns>A new translation matrix</returns>
        /// <param name="distanceX">Distance to translate along the x axis</param>
        /// <param name="distanceY">Distance to translate along the y axis</param>
        /// <param name="generator">Generator to create the matrix</param>
        public static IMatrix FromTranslation(float distanceX, float distanceY, Generator generator = null)
        {
            var matrix = Matrix.Create(generator);

            matrix.Translate(distanceX, distanceY);
            return(matrix);
        }
Exemplo n.º 10
0
        /// <summary>
        /// Creates a new matrix with a scale at the specified point
        /// </summary>
        /// <returns>A new matrix with a scale transform</returns>
        /// <param name="scaleX">The amount to multiply coordinates along the x axis</param>
        /// <param name="scaleY">The amount to multiply coordinates along the y axis</param>
        /// <param name="centerX">X co-ordinate of the point to scale from</param>
        /// <param name="centerY">Y co-ordinate of the point to scale from</param>
        /// <param name="generator">Generator to create the matrix</param>
        public static IMatrix FromScaleAt(float scaleX, float scaleY, float centerX, float centerY, Generator generator = null)
        {
            var matrix = Matrix.Create(generator);

            matrix.ScaleAt(scaleX, scaleY, centerX, centerY);
            return(matrix);
        }
Exemplo n.º 11
0
 /// <summary>
 /// Creates a new matrix with the specified scale factor
 /// </summary>
 /// <returns>A new matrix with a scale transform</returns>
 /// <param name="scaleX">The amount to multiply coordinates along the x axis</param>
 /// <param name="scaleY">The amount to multiply coordinates along the y axis</param>
 public static IMatrix FromScale(float scaleX, float scaleY)
 {
     return(Matrix.Create(scaleX, 0, 0, scaleY, 0, 0));
 }
Exemplo n.º 12
0
 public static IMatrix FromScale(float scaleX, float scaleY, Generator generator)
 {
     return(Matrix.Create(scaleX, 0, 0, scaleY, 0, 0, generator));
 }