some shit
This commit is contained in:
@@ -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() {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user