some shit

This commit is contained in:
2022-12-20 21:26:50 +01:00
parent a5cf2f2c1d
commit 3a3aa6be32
2 changed files with 44 additions and 6 deletions
+22
View File
@@ -11,6 +11,18 @@
#include "route.h"
Point::Point(double lat, double lon, uint32_t horizontalAccuracy) {
this->lat = lat;
this->lon = lon;
this->init(horizontalAccuracy);
}
Point::Point() {
this->lat = 0;
this->lon = 0;
this->init(0);
}
double Point::distanceTo(const Point &point) const {
// distance = sqrt(dx * dx + dy * dy)
@@ -39,6 +51,16 @@ double Point::courseTo(const Point &point) const {
return res;
}
void Point::init(uint32_t horizontalAccuracy) {
this->creationTime = millis();
if (horizontalAccuracy > 9999)
this->accuracy = PointAccuracy::fourDigOfCM;
else if (horizontalAccuracy > 999)
this->accuracy = PointAccuracy::threeDigOfCM
else if (horizontalAccuracy > 99)
}
Route::Route() {
}