Example #1
0
inline MATRIX_4x4 Invert(const MATRIX_4x4 &A,const int P)
{
    MATRIX_4x4 I,E,B;
    I = Scale(1.0f);
    B = 1.0f / (Norme_Ligne(A) * Norme_Colonne(A)) * Transpose(A);
    int i;
    for(i=0;i<P; ++i)
    {
        E = I - B*A;
        B = (I+E) * B;
        if(Norme_Ligne(E) == 0)
            i=P;
    }
    return B;
}
Example #2
0
	inline Matrix Invert(const Matrix &A,const int P)
	{
		Matrix I,E,B;
		I = Scale(1.0f);
		B = 1.0f / (Norme_Ligne(A) * Norme_Colonne(A)) * Transpose(A);
		int i;
		for(i=0;i<P; ++i)
		{
			E = I - B*A;
			B = (I+E) * B;
			if (Yuni::Math::Zero(Norme_Ligne(E)))
				i = P;
		}
		return B;
	}