draw aircraft
This commit is contained in:
@@ -4,3 +4,4 @@ constexpr char* user_agent = "p-rad/0.1";
|
||||
|
||||
|
||||
|
||||
#define ARRAY_LENGHT(arr) sizeof(arr) / sizeof(arr[0])
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <GeographicLib/Geodesic.hpp>
|
||||
#include <cmath>
|
||||
#include <tuple>
|
||||
#include "global.hpp"
|
||||
std::tuple<float, float> get_offset_from_station(double lat, double lon) {
|
||||
const GeographicLib::Geodesic &geod = GeographicLib::Geodesic::WGS84();
|
||||
|
||||
double distance, azi1, azi2;
|
||||
geod.Inverse(receiver_lat, receiver_lon, lat, lon, distance, azi1,
|
||||
azi2);
|
||||
|
||||
double azi_rad = azi1 * M_PI / 180.0;
|
||||
|
||||
|
||||
return {static_cast<float>(distance * std::sin(azi_rad)),static_cast<float>(-distance * std::cos(azi_rad))};
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
#include <tuple>
|
||||
std::tuple<float, float> get_offset_from_station(double lat, double lon);
|
||||
@@ -0,0 +1,2 @@
|
||||
float receiver_lat;
|
||||
float receiver_lon;
|
||||
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
extern float receiver_lat;
|
||||
extern float receiver_lon;
|
||||
Reference in New Issue
Block a user