--- trunk/src/math/SquareMatrix3.hpp 2005/09/27 20:02:57 633 +++ trunk/src/math/SquareMatrix3.hpp 2006/02/02 17:14:15 883 @@ -179,7 +179,7 @@ namespace oopse { Real ad1, ad2, ad3; t = this->data_[0][0] + this->data_[1][1] + this->data_[2][2] + 1.0; - if( t > 0.0 ){ + if( t > NumericConstant::epsilon ){ s = 0.5 / sqrt( t ); q[0] = 0.25 / s; @@ -316,6 +316,16 @@ namespace oopse { m /= det; return m; + } + + SquareMatrix3 transpose() const{ + SquareMatrix3 result; + + for (unsigned int i = 0; i < 3; i++) + for (unsigned int j = 0; j < 3; j++) + result(j, i) = this->data_[i][j]; + + return result; } /** * Extract the eigenvalues and eigenvectors from a 3x3 matrix.