point.h 582 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef _GEOMETRY_H
  2. #define _GEOMETRY_H
  3. #include<iostream>;
  4. #include <cmath>;
  5. using namespace std;
  6. class Point {
  7. //äàííûå
  8. public:
  9. double x, y;
  10. template <class value_class> Point(value_class ax, value_class ay);
  11. Point();
  12. //ôóíêöèè
  13. const double calc_distance(const Point& p);
  14. friend istream& operator >>(istream& is,Point a);
  15. friend ostream& operator <<(ostream& os,Point a);
  16. };
  17. template<class value_class>
  18. inline Point::Point(value_class ax, value_class ay)
  19. {
  20. x = (double)(ax);
  21. y = (double)(ay);
  22. }
  23. #endif // !_GEOMETRY_H