work in progress
This commit is contained in:
@ -74,3 +74,13 @@ void remove_from_list(std::vector<position>
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#include "math.h"
|
||||
|
||||
float distance(const position &a, const position &b) {
|
||||
return sqrt(distance_sqr(a, b));
|
||||
}
|
||||
|
||||
int distance_sqr(const position &a, const position &b) {
|
||||
return pow(a.x - b.x, 2) + pow(a.y - b.y, 2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user