Determinant() public method

public Determinant ( ) : float
return float
コード例 #1
0
ファイル: Matrix3.cs プロジェクト: damian-666/ReignSDK
        public static void Invert(ref Matrix3 matrix, out Matrix3 result)
        {
            float determinant = 1 / matrix.Determinant();

            result.X.X = (matrix.Y.Y * matrix.Z.Z - matrix.Y.Z * matrix.Z.Y) * determinant;
            result.X.Y = (matrix.X.Z * matrix.Z.Y - matrix.Z.Z * matrix.X.Y) * determinant;
            result.X.Z = (matrix.X.Y * matrix.Y.Z - matrix.Y.Y * matrix.X.Z) * determinant;

            result.Y.X = (matrix.Y.Z * matrix.Z.X - matrix.Y.X * matrix.Z.Z) * determinant;
            result.Y.Y = (matrix.X.X * matrix.Z.Z - matrix.X.Z * matrix.Z.X) * determinant;
            result.Y.Z = (matrix.X.Z * matrix.Y.X - matrix.X.X * matrix.Y.Z) * determinant;

            result.Z.X = (matrix.Y.X * matrix.Z.Y - matrix.Y.Y * matrix.Z.X) * determinant;
            result.Z.Y = (matrix.X.Y * matrix.Z.X - matrix.X.X * matrix.Z.Y) * determinant;
            result.Z.Z = (matrix.X.X * matrix.Y.Y - matrix.X.Y * matrix.Y.X) * determinant;
        }
コード例 #2
0
ファイル: Matrix3.cs プロジェクト: reignstudios/ReignSDK
        public static void Invert(ref Matrix3 matrix, out Matrix3 result)
        {
            float determinant = 1 / matrix.Determinant();

            result.X.X = (matrix.Y.Y * matrix.Z.Z - matrix.Y.Z * matrix.Z.Y) * determinant;
            result.X.Y = (matrix.X.Z * matrix.Z.Y - matrix.Z.Z * matrix.X.Y) * determinant;
            result.X.Z = (matrix.X.Y * matrix.Y.Z - matrix.Y.Y * matrix.X.Z) * determinant;

            result.Y.X = (matrix.Y.Z * matrix.Z.X - matrix.Y.X * matrix.Z.Z) * determinant;
            result.Y.Y = (matrix.X.X * matrix.Z.Z - matrix.X.Z * matrix.Z.X) * determinant;
            result.Y.Z = (matrix.X.Z * matrix.Y.X - matrix.X.X * matrix.Y.Z) * determinant;

            result.Z.X = (matrix.Y.X * matrix.Z.Y - matrix.Y.Y * matrix.Z.X) * determinant;
            result.Z.Y = (matrix.X.Y * matrix.Z.X - matrix.X.X * matrix.Z.Y) * determinant;
            result.Z.Z = (matrix.X.X * matrix.Y.Y - matrix.X.Y * matrix.Y.X) * determinant;
        }