// point.cc #include #include #include "point.h" template Point::Point(C x_coord, C y_coord): x(x_coord), y(y_coord){ } template Point::Point(): x(0.0), y(0.0){ } template C Point::getx () const{ return x; } template C Point::gety () const{ return y; } template Point& Point::move(C dx, C dy){ x += dx; y += dy; // Implicitly assume that + applies to C values return *this; } template double Point::distance_to(Point p){ return sqrt((x - p.x) * (x - p.x) + (y - p.y) * (y - p.y)); // Similar assumptions for - and * } template std::ostream& operator<< (std::ostream& s, const Point& p){ return s << "(" << p.getx() << "," << p.gety() << ")" ; }