geo: refactoring on comments and usage

This commit is contained in:
Matthias Grob
2021-12-06 14:30:14 +01:00
parent 8db7a6225b
commit 10ceea2fe6
16 changed files with 49 additions and 87 deletions
+1 -7
View File
@@ -44,8 +44,6 @@
#include "geo.h"
#include <mathlib/mathlib.h>
#include <matrix/math.hpp>
#include <float.h>
using matrix::wrap_pi;
@@ -60,19 +58,16 @@ using matrix::wrap_2pi;
* formulas according to: http://mathworld.wolfram.com/AzimuthalEquidistantProjection.html
*/
void MapProjection::initReference(double lat_0, double lon_0, uint64_t timestamp)
{
_ref_timestamp = timestamp;
_ref_lat = math::radians(lat_0);
_ref_lon = math::radians(lon_0);
_ref_sin_lat = sin(_ref_lat);
_ref_cos_lat = cos(_ref_lat);
_ref_timestamp = timestamp;
_ref_init_done = true;
}
void MapProjection::project(double lat, double lon, float &x, float &y) const
{
const double lat_rad = math::radians(lat);
@@ -116,7 +111,6 @@ void MapProjection::reproject(float x, float y, double &lat, double &lon) const
lat = math::degrees(_ref_lat);
lon = math::degrees(_ref_lon);
}
}
float get_distance_to_next_waypoint(double lat_now, double lon_now, double lat_next, double lon_next)