VXL Maintainers:

Jason Zhang here at GE made these straightforward additions to vgl_point_2d.h.  Is it OK to check this in?  This looks like a no-brainer, but the fact that such simple and useful functions were not already in vgl make we wonder whether there is a reason to not have them.

Fred

% cvs di  vgl_point_2d.h
Index: vgl_point_2d.h
===================================================================
RCS file: /cvsroot/vxl/vxl/core/vgl/vgl_point_2d.h,v
retrieving revision 1.37
diff -u -r1.37 vgl_point_2d.h
--- vgl_point_2d.h      5 Dec 2003 14:19:32 -0000       1.37
+++ vgl_point_2d.h      16 Jul 2007 19:30:11 -0000
@@ -13,6 +13,8 @@
 //  Modifications
 //   29 June 2001 Peter Vanroose moved arithmetic operators to new vgl_vector_2d
 //    2 July 2001 Peter Vanroose implemented constructor from homg point
+//    11 June 2007 Jason Zhang - added inline self-manipulation operators
+//      '+=', '*=' and '/=', and binary manipulation operators '+', '*' and '/'
 // \endverbatim
 
 #include <vcl_iosfwd.h>
@@ -65,6 +67,16 @@
   inline bool operator!=(vgl_point_2d<Type>const& p)const
   { return !operator==(p); }
 
+  //: Self addition
+  inline vgl_point_2d<Type>& operator+=(const vgl_point_2d<Type>& p)
+  { x_ += p.x(); y_ += p.y(); return *this; }
+  //: Self multiplication by a scalar value
+  inline vgl_point_2d<Type>& operator*=(const Type& d)
+  { x_ *= d; y_ *= d; return *this; }
+  //: Self division by a scalar value other than 0 (not checked)
+  inline vgl_point_2d<Type>& operator/=(const Type& d)
+  { x_ /= d; y_ /= d; return *this; }
+
   // Data Access-------------------------------------------------------------
 
   inline Type &x() {return x_;}
@@ -119,6 +131,22 @@
                              vgl_vector_2d<Type> const& v)
 { return vgl_point_2d<Type>(p.x()+v.x(), p.y()+v.y()); }
 
+//: Addition of two points
+template <class Type> inline
+vgl_point_2d<Type> operator+(vgl_point_2d<Type> const& p1,
+                             vgl_point_2d<Type> const& p2)
+{ return vgl_point_2d<Type>(p1.x()+p2.x(), p1.y()+p2.y()); }
+
+//: Multiplication by a scalar value
+template <class Type> inline
+vgl_point_2d<Type> operator*(vgl_point_2d<Type> const& p, const Type& d)
+{ return vgl_point_2d<Type>(p.x()*d, p.y()*d); }
+
+//: Division by a scalar value other than 0 (not checked)
+template <class Type> inline
+vgl_point_2d<Type> operator/(vgl_point_2d<Type> const& p, const Type& d)
+{ return vgl_point_2d<Type>(p.x()/d, p.y()/d); }
+
 //: Adding a vector to a point gives the point at the end of that vector
 // \relates vgl_point_2d
 template <class Type> inline