diff --git a/gtsam/geometry/Rot3.cpp b/gtsam/geometry/Rot3.cpp index ef82e9369..72124d25d 100644 --- a/gtsam/geometry/Rot3.cpp +++ b/gtsam/geometry/Rot3.cpp @@ -73,7 +73,7 @@ Point3 Rot3::operator*(const Point3& p) const { /* ************************************************************************* */ Sphere2 Rot3::rotate(const Sphere2& p, boost::optional HR, boost::optional Hp) const { - Sphere2 q = rotate(p.point3(Hp)); + Sphere2 q = Sphere2(rotate(p.point3(Hp))); if (Hp) (*Hp) = q.basis().transpose() * matrix() * (*Hp); if (HR) @@ -84,7 +84,7 @@ Sphere2 Rot3::rotate(const Sphere2& p, /* ************************************************************************* */ Sphere2 Rot3::unrotate(const Sphere2& p, boost::optional HR, boost::optional Hp) const { - Sphere2 q = unrotate(p.point3(Hp)); + Sphere2 q = Sphere2(unrotate(p.point3(Hp))); if (Hp) (*Hp) = q.basis().transpose() * matrix().transpose () * (*Hp); if (HR) diff --git a/gtsam/geometry/Sphere2.h b/gtsam/geometry/Sphere2.h index ac8124139..d4047f421 100644 --- a/gtsam/geometry/Sphere2.h +++ b/gtsam/geometry/Sphere2.h @@ -60,7 +60,7 @@ public: } /// Construct from point - Sphere2(const Point3& p) : + explicit Sphere2(const Point3& p) : p_(p / p.norm()) { }