#ifndef _POINT_H #define _POINT_H #include // Point is just a point on a 2D plane class point { public: point(double x = 0.0, double y = 0.0); ~point(); // Gets our position double positionX() const { return _pos_x; } double positionY() const { return _pos_y; } // Sets our position void setPositionX(double new_pos) {_pos_x = new_pos;} void setPositionY(double new_pos) {_pos_y = new_pos;} void setPosition(double new_x, double new_y) {_pos_x = new_x; _pos_y = new_y; } void setPosition(const point &p) {_pos_x = p._pos_x; _pos_y = p._pos_y; } // Finds the distance between us and another point double distance(const point &other_point) const; // Finds the angle between us and another point double angle(const point &other_point) const { return atan2(other_point._pos_y - _pos_y, other_point._pos_x - _pos_x); } protected: double _pos_x; double _pos_y; }; #endif