int Coordinates::Distance(Coordinates a, Coordinates b)
{
- return (int)sqrt((double)((a.GetX() - b.GetX()) * (a.GetX() - b.GetX())+ (a.GetY() - b.GetY()) * (a.GetY() - b.GetY())));
+ return (int)sqrt((double)((a.GetX() - b.GetX()) * (a.GetX() - b.GetX()) + (a.GetY() - b.GetY()) * (a.GetY() - b.GetY())) - 0.5f);
}
int Coordinates::Distance(int x1, int y1, int x2, int y2)
{
- return (int)sqrt((double)((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
+ return (int)sqrt((double)((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)) - 0.5f);
}
int Coordinates::Distance(Coordinates a)