work in progress

This commit is contained in:
2024-07-13 18:22:15 -04:00
parent 8da12f5360
commit 39d3447593
8 changed files with 105 additions and 3 deletions

View File

@ -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);
}