Exemple #1
0
        /// <summary>
        ///     Implements the operator * to transform a <see cref="Vector2" /> with a <see cref="Matrix3x3" />.
        /// </summary>
        /// <param name="matrix">The <see cref="Matrix3x3" />.</param>
        /// <param name="vector">The <see cref="Vector2" />.</param>
        /// <returns>
        ///     The result of the operator.
        /// </returns>
        public static Vector2 operator *(Matrix3x3 matrix, Vector2 vector)
        {
            var resultMatrix = MatrixUtils.Multiply <Matrix3x1>(matrix,
                                                                new Vector3(vector.X, vector.Y, 1).AsVerticalMatrix <Matrix3x1>());

            return(new Vector2(resultMatrix[0], resultMatrix[1]));
        }
Exemple #2
0
 /// <summary>
 ///     Implements the operator *.
 /// </summary>
 /// <param name="firstMatrix">The first <see cref="Matrix3x3" />.</param>
 /// <param name="secondMatrix">The second <see cref="Matrix3x3" />.</param>
 /// <returns>
 ///     The result of the operator.
 /// </returns>
 public static Matrix3x3 operator *(Matrix3x3 firstMatrix, Matrix3x3 secondMatrix)
 {
     return(MatrixUtils.Multiply <Matrix3x3>(firstMatrix, secondMatrix));
 }
Exemple #3
0
        /// <summary>
        ///     Implements the operator * to transform a <see cref="Vector3" /> with a <see cref="Matrix3x3" />.
        /// </summary>
        /// <param name="matrix">The <see cref="Matrix3x3" />.</param>
        /// <param name="vector">The <see cref="Vector3" />.</param>
        /// <returns>
        ///     The result of the operator.
        /// </returns>
        public static Vector3 operator *(Matrix3x3 matrix, Vector3 vector)
        {
            var resultMatrix = MatrixUtils.Multiply <Matrix3x1>(matrix, vector.AsVerticalMatrix <Matrix3x1>());

            return(new Vector3(resultMatrix[0], resultMatrix[1], resultMatrix[2]));
        }
Exemple #4
0
 /// <summary>
 ///     Implements the operator * to multiply a <see cref="Matrix3x3" /> with the specified scalar.
 /// </summary>
 /// <param name="matrix">The <see cref="Matrix3x3" />.</param>
 /// <param name="scalar">The scalar.</param>
 /// <returns>
 ///     The result of the operator.
 /// </returns>
 public static Matrix3x3 operator *(Matrix3x3 matrix, double scalar)
 {
     return(MatrixUtils.Multiply(matrix, scalar));
 }
Exemple #5
0
 /// <summary>
 ///     Implements the operator +.
 /// </summary>
 /// <param name="firstMatrix">The first <see cref="Matrix3x3" />.</param>
 /// <param name="secondMatrix">The second <see cref="Matrix3x3" />.</param>
 /// <returns>
 ///     The result of the operator.
 /// </returns>
 public static Matrix3x3 operator +(Matrix3x3 firstMatrix, Matrix3x3 secondMatrix)
 {
     return(MatrixUtils.Add(firstMatrix, secondMatrix));
 }
Exemple #6
0
 /// <summary>
 ///     Implements the operator -.
 /// </summary>
 /// <param name="firstMatrix">The first <see cref="Matrix3x3" />.</param>
 /// <param name="secondMatrix">The second <see cref="Matrix3x3" />.</param>
 /// <returns>
 ///     The result of the operator.
 /// </returns>
 public static Matrix3x3 operator -(Matrix3x3 firstMatrix, Matrix3x3 secondMatrix)
 {
     return(MatrixUtils.Subtract(firstMatrix, secondMatrix));
 }
Exemple #7
0
 /// <summary>
 ///     Implements the operator *.
 /// </summary>
 /// <param name="firstMatrix">The first <see cref="Matrix2x2" />.</param>
 /// <param name="secondMatrix">The second <see cref="Matrix2x2" />.</param>
 /// <returns>
 ///     The result of the operator.
 /// </returns>
 public static Matrix2x2 operator *(Matrix2x2 firstMatrix, Matrix2x2 secondMatrix)
 {
     return(MatrixUtils.Multiply <Matrix2x2>(firstMatrix, secondMatrix));
 }
Exemple #8
0
 /// <summary>
 ///     Implements the operator * to multiply a <see cref="Matrix2x2" /> with the specified scalar.
 /// </summary>
 /// <param name="scalar">The scalar.</param>
 /// <param name="matrix">The <see cref="Matrix2x2" />.</param>
 /// <returns>
 ///     The result of the operator.
 /// </returns>
 public static Matrix2x2 operator *(double scalar, Matrix2x2 matrix)
 {
     return(MatrixUtils.Multiply(matrix, scalar));
 }
Exemple #9
0
 /// <summary>
 ///     Implements the operator +.
 /// </summary>
 /// <param name="firstMatrix">The first <see cref="Matrix2x2" />.</param>
 /// <param name="secondMatrix">The second <see cref="Matrix2x2" />.</param>
 /// <returns>
 ///     The result of the operator.
 /// </returns>
 public static Matrix2x2 operator +(Matrix2x2 firstMatrix, Matrix2x2 secondMatrix)
 {
     return(MatrixUtils.Add(firstMatrix, secondMatrix));
 }
Exemple #10
0
 /// <summary>
 ///     Implements the operator *.
 /// </summary>
 /// <param name="firstMatrix">The first <see cref="Matrix1x1" />.</param>
 /// <param name="secondMatrix">The second <see cref="Matrix1x1" />.</param>
 /// <returns>
 ///     The result of the operator.
 /// </returns>
 public static Matrix1x1 operator *(Matrix1x1 firstMatrix, Matrix1x1 secondMatrix)
 {
     return(MatrixUtils.Multiply <Matrix1x1>(firstMatrix, secondMatrix));
 }
Exemple #11
0
 /// <summary>
 ///     Implements the operator +.
 /// </summary>
 /// <param name="firstMatrix">The first <see cref="Matrix1x1" />.</param>
 /// <param name="secondMatrix">The second <see cref="Matrix1x1" />.</param>
 /// <returns>
 ///     The result of the operator.
 /// </returns>
 public static Matrix1x1 operator +(Matrix1x1 firstMatrix, Matrix1x1 secondMatrix)
 {
     return(MatrixUtils.Add(firstMatrix, secondMatrix));
 }