point.h 512 B

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