123456789101112131415161718192021222324 |
- #include "Point2D.h"
- CPoint2D::CPoint2D(double x, double y)
- {
- this->x = x;
- this->y = y;
- }
- CPoint2D::~CPoint2D()
- {
- }
- double CPoint2D::GetDistance(CPoint2D &pt1, CPoint2D &pt2)
- {
- return sqrt((pt1.x - pt2.x)*(pt1.x - pt2.x) + (pt1.y - pt2.y)*(pt1.y - pt2.y));
- }
- double CPoint2D::GetDistance(CPoint2D &pt)
- {
- return sqrt((x - pt.x)*(x - pt.x) + (y - pt.y)*(y - pt.y));
- }
|