260 |
|
|
261 |
|
return(x + y + z); |
262 |
|
} |
263 |
+ |
|
264 |
+ |
/** Returns the trace of this matrix. */ |
265 |
+ |
Real trace() const { |
266 |
+ |
return data_[0][0] + data_[1][1] + data_[2][2]; |
267 |
+ |
} |
268 |
|
|
269 |
|
/** |
270 |
|
* Sets the value of this matrix to the inversion of itself. |
460 |
|
return result; |
461 |
|
} |
462 |
|
|
463 |
+ |
template<typename Real> |
464 |
+ |
inline SquareMatrix3<Real> outProduct(const Vector3<Real>& v1, const Vector3<Real>& v2) { |
465 |
+ |
SquareMatrix3<Real> result; |
466 |
+ |
|
467 |
+ |
for (unsigned int i = 0; i < 3; i++) { |
468 |
+ |
for (unsigned int j = 0; j < 3; j++) { |
469 |
+ |
result(i, j) = v1[i] * v2[j]; |
470 |
+ |
} |
471 |
+ |
} |
472 |
+ |
|
473 |
+ |
return result; |
474 |
+ |
} |
475 |
+ |
|
476 |
+ |
|
477 |
|
typedef SquareMatrix3<double> Mat3x3d; |
478 |
|
typedef SquareMatrix3<double> RotMat3x3d; |
479 |
|
|