From 2ef0432df4da16208c111fd63cebdaf65e45281b Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Tue, 24 Jan 2012 03:12:03 +0000 Subject: [PATCH] a bit more specific on between, as it can be confusing --- gtsam/geometry/Point2.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gtsam/geometry/Point2.h b/gtsam/geometry/Point2.h index 3bde22db6..fe86cc865 100644 --- a/gtsam/geometry/Point2.h +++ b/gtsam/geometry/Point2.h @@ -77,34 +77,34 @@ public: return Point2(); } - /// "Inverse" - negates each coordinate such that compose(p,inverse(p))=Point2() + /// "Inverse" - negates each coordinate such that compose(p,inverse(p)) == identity() inline Point2 inverse() const { return Point2(-x_, -y_); } - /// syntactic sugar for inverse + /// syntactic sugar for inverse, i.e., -p == inverse(p) inline Point2 operator- () const {return Point2(-x_,-y_);} /// "Compose", just adds the coordinates of two points. With optional derivatives - inline Point2 compose(const Point2& p2, + inline Point2 compose(const Point2& q, boost::optional H1=boost::none, boost::optional H2=boost::none) const { if(H1) *H1 = eye(2); if(H2) *H2 = eye(2); - return *this + p2; + return *this + q; } - /// syntactic sugar for adding two points (compose()) + /// syntactic sugar for adding two points, i.e., p+q == compose(p,q) inline Point2 operator + (const Point2& q) const {return Point2(x_+q.x_,y_+q.y_);} - /// "Between", subtracts point coordinates. between(p,q) = compose(inverse(p),q) - inline Point2 between(const Point2& p2, + /// "Between", subtracts point coordinates. between(p,q) == compose(inverse(p),q) + inline Point2 between(const Point2& q, boost::optional H1=boost::none, boost::optional H2=boost::none) const { if(H1) *H1 = -eye(2); if(H2) *H2 = eye(2); - return p2 - (*this); + return q - (*this); } - /// syntactic sugar for vector subtraction, i.e., between() + /// syntactic sugar for subtracting points, i.e., q-p == between(p,q) inline Point2 operator - (const Point2& q) const {return Point2(x_-q.x_,y_-q.y_);} /// @}