more efficient and explicit inverse()

release/4.3a0
Varun Agrawal 2020-03-17 15:10:13 -04:00
parent e987cb53a0
commit cd88c795ae
1 changed files with 3 additions and 3 deletions

View File

@ -198,7 +198,7 @@ namespace gtsam {
* @param angle rotation angle * @param angle rotation angle
* @return incremental rotation * @return incremental rotation
*/ */
static Rot3 AxisAngle(const Vector3& axis, double angle) { static Rot3 AxisAngle(const Point3& axis, double angle) {
// Convert to unit vector. // Convert to unit vector.
Vector3 unitAxis = Unit3(axis).unitVector(); Vector3 unitAxis = Unit3(axis).unitVector();
#ifdef GTSAM_USE_QUATERNIONS #ifdef GTSAM_USE_QUATERNIONS
@ -273,9 +273,9 @@ namespace gtsam {
/// inverse of a rotation /// inverse of a rotation
Rot3 inverse() const { Rot3 inverse() const {
#ifdef GTSAM_USE_QUATERNIONS #ifdef GTSAM_USE_QUATERNIONS
return quaternion_.inverse(); return Rot3(quaternion_.inverse());
#else #else
return Rot3(transpose()); return Rot3(rot_.matrix().transpose());
#endif #endif
} }