123456789101112131415161718192021222324252627282930313233 |
- #include <cmath>;
- #include <iostream>;
- #include "point.h"
- using namespace std;
- Point::Point()
- {
- }
- //Point
- const double
- Point::calc_distance(const Point& p) {
- double dx = x - p.x;
- double dy = y - p.y;
- return sqrt(dx * dx + dy * dy);
- }
- istream& operator>>(istream& is, Point a)
- {
- return is >> a.x >> a.y;
- }
- ostream& operator<<(ostream& os, Point a)
- {
- return os << "(" << a.x << ", " << a.y << ")";
- }
|