/* * Copyright ©2020 Hal Perkins. All rights reserved. Permission is * hereby granted to students registered for University of Washington * CSE 333 for use solely during Spring Quarter 2020 for purposes of * the course. No other use, copying, distribution, or modification * is permitted without prior written consent. Copyrights for * third-party components of this work must be honored. Instructors * interested in reusing these course materials should contact the * author. */ #ifndef POINT_H_ #define POINT_H_ class Point { public: // Constructs a point that represents the Cartesian point (x, y) Point(int x, int y); // Returns the x component of this point. int get_x() const { return x_; } // Returns the y component of this point. int get_y() const { return y_; } // Returns the distance between this point and the provided point. double Distance(const Point & p) const; // Sets the current point to represent the passed in coordinates. void SetLocation(int x, int y); private: int x_, y_; }; #endif // POINT_H_