diff --git a/math/genvector/inc/Math/GenVector/Rotation3D.h b/math/genvector/inc/Math/GenVector/Rotation3D.h index 5bd3b3fabe6dc..55409e2ebda61 100644 --- a/math/genvector/inc/Math/GenVector/Rotation3D.h +++ b/math/genvector/inc/Math/GenVector/Rotation3D.h @@ -34,6 +34,7 @@ #include "Math/GenVector/RotationYfwd.h" #include "Math/GenVector/RotationZfwd.h" +#include "Math/GenVector/GenVector_exception.h" #include #include @@ -345,6 +346,20 @@ class Rotation3D { // =========== operations ============== + /** + Access operator, used to have direct access to rotation matrix's entries + \param i row index in {0,1,2} + \param j column index in {0,1,2} + */ + Scalar operator()(size_t i, size_t j) const + { + if (i < 3 && j < 3) + return fM[i + 3 * j]; + else + GenVector::Throw("Rotation3D::operator(size_t i, size_t j):\n" + " indices i and j must range in {0,1,2}"); + return 0.0; + } /** Rotation operation on a displacement vector in any coordinate system