#include #include "point.h" /* * Makes a new inverted point by copying this points x and y values * and negating them. */ Point Point::invert() { Point newPoint; // we can access private members of other Points in any method of Point. newPoint.x = -x; newPoint.y = -y; return (newPoint); } /* * this prints a point out like (x, y) on the output stream 'out'. * it returns true on success. */ bool Point::print(ostream &out) { return( bool (out << '(' << x << ", " << y << ')' )); } Point::Point() { x = 0; y = 0; } Point::Point(int xIn, int yIn) { x = xIn; y = yIn; } int Point::getX() { return x; } int Point::getY() { return y; }