diff --git a/gtsam/geometry/Rot2.cpp b/gtsam/geometry/Rot2.cpp index 08279450e..8be5e9d93 100644 --- a/gtsam/geometry/Rot2.cpp +++ b/gtsam/geometry/Rot2.cpp @@ -82,11 +82,7 @@ Matrix2 Rot2::transpose() const { Point2 Rot2::rotate(const Point2& p, OptionalJacobian<2, 1> H1, OptionalJacobian<2, 2> H2) const { const Point2 q = Point2(c_ * p.x() + -s_ * p.y(), s_ * p.x() + c_ * p.y()); - if (H1) { - Matrix21 H1_; - H1_ << -q.y(), q.x(); - *H1 = H1_; - } + if (H1) *H1 << -q.y(), q.x(); if (H2) *H2 = matrix(); return q; }