Beispiel #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 FPMatrix operator -(FPMatrix value1, FPMatrix value2)
        {
            FPMatrix result; FPMatrix.Multiply(ref value2, -FP.One, out value2);

            FPMatrix.Add(ref value1, ref value2, out result);
            return(result);
        }
Beispiel #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, FP scaleFactor)
        public static FPMatrix Multiply(FPMatrix matrix1, FP scaleFactor)
        {
            FPMatrix result;

            FPMatrix.Multiply(ref matrix1, scaleFactor, out result);
            return(result);
        }
Beispiel #3
0
        /// <summary>
        /// Gets the determinant of the matrix.
        /// </summary>
        /// <returns>The determinant of the matrix.</returns>
        #region public FP Determinant()
        //public FP 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 FPMatrix Multiply(FPMatrix matrix1, FPMatrix matrix2)
        {
            FPMatrix result;

            FPMatrix.Multiply(ref matrix1, ref matrix2, out result);
            return(result);
        }
Beispiel #4
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 FPMatrix operator *(FPMatrix value1, FPMatrix value2)
        {
            FPMatrix result; FPMatrix.Multiply(ref value1, ref value2, out result);

            return(result);
        }