/* * 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. */ #include "./Point.h" #include Point::Point(int x, int y) { x_ = x; this->y_ = y; } double Point::Distance(const Point &p) const { double xdiff = pow(x_ - p.x_, 2); double ydiff = pow(y_ - p.y_, 2); return sqrt(xdiff + ydiff); } void Point::SetLocation(int x, int y) { x_ = x; this->y_ = y; }