// Point.cpp #include "Point.h" Point::Point(int x, int y) : _x(x), _y(y) { } Point::Point(const Point& p) : _x(p._x), _y(p._y) { } Point::~Point(void) { } int Point::getx(void) const { return _x; } int Point::gety(void) const { return _y; } void Point::set(int x, int y) { _x = x; _y = y; } void Point::move(int dx, int dy) { _x += dx; _y += dy; } Point& Point::operator+=(const Point& p) { _x += p._x; _y += p._y; return *this; } Point Point::operator+(const Point& p) { Point point(*this); point += p; return point; } int Point::operator()(void) { return ((_x *_x) + (_y *_y)); } ostream& operator<<(ostream& s, const Point& p) { return s << '(' << p._x << ',' << p._y << ')'; }