|
|
|
@ -8,7 +8,7 @@
@@ -8,7 +8,7 @@
|
|
|
|
|
#include "vector2.h" |
|
|
|
|
#include "vector3.h" |
|
|
|
|
|
|
|
|
|
// scaling factor from 1e-7 degrees to meters at equater
|
|
|
|
|
// scaling factor from 1e-7 degrees to meters at equator
|
|
|
|
|
// == 1.0e-7 * DEG_TO_RAD * RADIUS_OF_EARTH
|
|
|
|
|
#define LOCATION_SCALING_FACTOR 0.011131884502145034f |
|
|
|
|
// inverse of LOCATION_SCALING_FACTOR
|
|
|
|
@ -27,9 +27,15 @@ float get_distance(const struct Location &loc1, const struct Location &lo
@@ -27,9 +27,15 @@ float get_distance(const struct Location &loc1, const struct Location &lo
|
|
|
|
|
// return distance in centimeters between two locations
|
|
|
|
|
uint32_t get_distance_cm(const struct Location &loc1, const struct Location &loc2); |
|
|
|
|
|
|
|
|
|
// return horizontal distance in centimeters between two positions
|
|
|
|
|
float get_horizontal_distance_cm(const Vector3f &origin, const Vector3f &destination); |
|
|
|
|
|
|
|
|
|
// return bearing in centi-degrees between two locations
|
|
|
|
|
int32_t get_bearing_cd(const struct Location &loc1, const struct Location &loc2); |
|
|
|
|
|
|
|
|
|
// return bearing in centi-degrees between two positions
|
|
|
|
|
float get_bearing_cd(const Vector3f &origin, const Vector3f &destination); |
|
|
|
|
|
|
|
|
|
// see if location is past a line perpendicular to
|
|
|
|
|
// the line between point1 and point2. If point1 is
|
|
|
|
|
// our previous waypoint and point2 is our target waypoint
|
|
|
|
|