2016-02-25 08:07:27 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
|
|
#include "vector2.h"
|
|
|
|
#include "vector3.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* LOCATION
|
|
|
|
*/
|
|
|
|
|
2017-12-03 17:04:30 -04:00
|
|
|
// 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 positions
|
|
|
|
float get_bearing_cd(const Vector3f &origin, const Vector3f &destination);
|
|
|
|
|
2016-02-25 08:07:27 -04:00
|
|
|
// Converts from WGS84 geodetic coordinates (lat, lon, height)
|
|
|
|
// into WGS84 Earth Centered, Earth Fixed (ECEF) coordinates
|
|
|
|
// (X, Y, Z)
|
|
|
|
void wgsllh2ecef(const Vector3d &llh, Vector3d &ecef);
|
|
|
|
|
|
|
|
// Converts from WGS84 Earth Centered, Earth Fixed (ECEF)
|
|
|
|
// coordinates (X, Y, Z), into WHS84 geodetic
|
|
|
|
// coordinates (lat, lon, height)
|
|
|
|
void wgsecef2llh(const Vector3d &ecef, Vector3d &llh);
|
|
|
|
|
2016-06-01 18:43:01 -03:00
|
|
|
// return true when lat and lng are within range
|
2019-07-24 20:25:06 -03:00
|
|
|
bool check_lat(float lat) WARN_IF_UNUSED;
|
|
|
|
bool check_lng(float lng) WARN_IF_UNUSED;
|
|
|
|
bool check_lat(int32_t lat) WARN_IF_UNUSED;
|
|
|
|
bool check_lng(int32_t lng) WARN_IF_UNUSED;
|
|
|
|
bool check_latlng(float lat, float lng) WARN_IF_UNUSED;
|
|
|
|
bool check_latlng(int32_t lat, int32_t lng) WARN_IF_UNUSED;
|