draw aircraft

This commit is contained in:
2026-08-05 13:05:30 +02:00
parent 25824ac2f9
commit 704126fd3f
10 changed files with 66 additions and 7 deletions
+1
View File
@@ -4,3 +4,4 @@ constexpr char* user_agent = "p-rad/0.1";
#define ARRAY_LENGHT(arr) sizeof(arr) / sizeof(arr[0])
+16
View File
@@ -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))};
}
+3
View File
@@ -0,0 +1,3 @@
#pragma once
#include <tuple>
std::tuple<float, float> get_offset_from_station(double lat, double lon);
+2
View File
@@ -0,0 +1,2 @@
float receiver_lat;
float receiver_lon;
+3
View File
@@ -0,0 +1,3 @@
#pragma once
extern float receiver_lat;
extern float receiver_lon;