Example #1
0
 /// <summary>
 /// Subtracts two matrices.
 /// </summary>
 /// <param name="value1">The first matrix.</param>
 /// <param name="value2">The second matrix.</param>
 /// <returns>The difference of both values.</returns>
 #region public static JMatrix operator -(JMatrix value1, JMatrix value2)
 public static JMatrix operator -(JMatrix value1, JMatrix value2)
 {
     JMatrix result; JMatrix.Multiply(ref value2, -1.0f, out value2);
     JMatrix.Add(ref value1, ref value2, out result);
     return result;
 }
Example #2
0
 /// <summary>
 /// Multiply a matrix by a scalefactor.
 /// </summary>
 /// <param name="matrix1">The matrix.</param>
 /// <param name="scaleFactor">The scale factor.</param>
 /// <returns>A JMatrix multiplied by the scale factor.</returns>
 #region public static JMatrix Multiply(JMatrix matrix1, float scaleFactor)
 public static JMatrix Multiply(JMatrix matrix1, float scaleFactor)
 {
     JMatrix result;
     JMatrix.Multiply(ref matrix1, scaleFactor, out result);
     return result;
 }
Example #3
0
 /// <summary>
 /// Multiplies two matrices.
 /// </summary>
 /// <param name="value1">The first matrix.</param>
 /// <param name="value2">The second matrix.</param>
 /// <returns>The product of both values.</returns>
 #region public static JMatrix operator *(JMatrix value1,JMatrix value2)
 public static JMatrix operator *(JMatrix value1,JMatrix value2)
 {
     JMatrix result; JMatrix.Multiply(ref value1, ref value2, out result);
     return result;
 }
Example #4
0
        /// <summary>
        /// Gets the determinant of the matrix.
        /// </summary>
        /// <returns>The determinant of the matrix.</returns>
        #region public float Determinant()
        //public float Determinant()
        //{
        //    return M11 * M22 * M33 -M11 * M23 * M32 -M12 * M21 * M33 +M12 * M23 * M31 + M13 * M21 * M32 - M13 * M22 * M31;
        //}
        #endregion

        /// <summary>
        /// Multiply two matrices. Notice: matrix multiplication is not commutative.
        /// </summary>
        /// <param name="matrix1">The first matrix.</param>
        /// <param name="matrix2">The second matrix.</param>
        /// <returns>The product of both matrices.</returns>
        #region public static JMatrix Multiply(JMatrix matrix1, JMatrix matrix2)
        public static JMatrix Multiply(JMatrix matrix1, JMatrix matrix2)
        {
            JMatrix result;
            JMatrix.Multiply(ref matrix1, ref matrix2, out result);
            return result;
        }