/* * point.cpp * * Created on: 16.04.2013 * Author: trifon */ #include #include "point.h" template Point::Point(T const& _x, T const& _y) : x(_x), y(_y) {} // също може и { x = _x; y = _y; } template T Point::getX() const { return x; } template T Point::getY() const { return y; } template double Point::distance(Point const& p) const { return sqrt((x-p.x)*(x-p.x) + (y-p.y)*(y-p.y)); } template ostream& operator<<(ostream& os, Point const& p) { return os << '(' << p.x << ',' << p.y << ')' << endl; }