//******************************************** // Det4 //******************************************** double CMatrix44::Det4() const { return (m_data[0][0] * Det3(1,2,3,1,2,3) - m_data[0][1] * Det3(1,2,3,0,2,3) + m_data[0][2] * Det3(1,2,3,0,1,3) - m_data[0][3] * Det3(1,2,3,0,1,2)); }
cTRANSFORM3 cTRANSFORM3::Inverse() const // FIXME : construction { REAL w = 1.0/Det3(t11, t12, t13, t21, t22, t23, t31, t32, t33 ); return cTRANSFORM3(Det2( t22, t23, t32, t33)*w, // i 11 -Det2( t12, t13, t32, t33)*w, // i 12 Det2( t12, t13, t22, t23)*w, // i 13 -Det3( t12, t13, t14, t22, t23, t24, t32, t33, t34 )*w, -Det2( t21, t23, t31, t33)*w, // i 21 Det2( t11, t13, t31, t33)*w, // i 22 -Det2( t11, t13, t21, t23)*w, // i 23 Det3( t11, t13, t14, t21, t23, t24, t31, t33, t34 )*w, Det2( t21, t22, t31, t32)*w, // i 31 -Det2( t11, t12, t31, t32)*w, // i 32 Det2( t11, t12, t21, t22)*w, // i 33 -Det3( t11, t12, t14, t21, t22, t24, t31, t32, t34 )*w); //Det3( t11, t12, t13, t21, t22, t23, t31, t32, t33 )); }
//******************************************** // Adjoint // Returns the adjoint of the 4x4 matrix. // Adjoint_ij = (-1)^(i+j) * alpha_ji // where alpha_ij is the determinant of the // submatrix of A without row i and column j //******************************************** CMatrix44 CMatrix44::Adjoint() const { CMatrix44 a; a[0][0] = Det3(1,2,3,1,2,3); a[0][1] = -Det3(0,2,3,1,2,3); a[0][2] = Det3(0,1,3,1,2,3); a[0][3] = -Det3(0,1,2,1,2,3); a[1][0] = -Det3(1,2,3,0,2,3); a[1][1] = Det3(0,2,3,0,2,3); a[1][2] = -Det3(0,1,3,0,2,3); a[1][3] = Det3(0,1,2,0,2,3); a[2][0] = Det3(1,2,3,0,1,3); a[2][1] = -Det3(0,2,3,0,1,3); a[2][2] = Det3(0,1,3,0,1,3); a[2][3] = -Det3(0,1,2,0,1,3); a[3][0] = -Det3(1,2,3,0,1,2); a[3][1] = Det3(0,2,3,0,1,2); a[3][2] = -Det3(0,1,3,0,1,2); a[3][3] = Det3(0,1,2,0,1,2); return a; }