Fusion.Core.Mathematics.Matrix3x2.Determinant C# (CSharp) Метод

Determinant() публичный Метод

Calculates the determinant of this matrix.
public Determinant ( ) : float
Результат float
        public float Determinant()
        {
                return (M11 * M22) - (M12 * M21);
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Calculates the inverse of the specified matrix.
        /// </summary>
        /// <param name="value">The matrix whose inverse is to be calculated.</param>
        /// <param name="result">When the method completes, contains the inverse of the specified matrix.</param>
        public static void Invert(ref Matrix3x2 value, out Matrix3x2 result)
        {
            float determinant = value.Determinant();

            if (MathUtil.IsZero(determinant))
            {
                result = Identity;
                return;
            }

            float invdet   = 1.0f / determinant;
            float _offsetX = value.M31;
            float _offsetY = value.M32;

            result = new Matrix3x2(
                value.M22 * invdet,
                -value.M12 * invdet,
                -value.M21 * invdet,
                value.M11 * invdet,
                (value.M21 * _offsetY - _offsetX * value.M22) * invdet,
                (_offsetX * value.M12 - value.M11 * _offsetY) * invdet);
        }
All Usage Examples Of Fusion.Core.Mathematics.Matrix3x2::Determinant