REfactor SimDatabase PRODUCES CRASH ON EXIT

This commit is contained in:
2022-09-11 04:31:01 +02:00
parent 4445f1f12a
commit 161941ac1b
11 changed files with 207 additions and 140 deletions
+13
View File
@@ -77,6 +77,19 @@ namespace geodata
return 2.0 * EARTH_M * asin(sqrt(u * u + cos(lat1r) * cos(lat2r) * v * v));
}
// Input in degrees, Output in metres
static inline double distanceEarthP(point from, point to)
{
double lat1r, lon1r, lat2r, lon2r, u, v;
lat1r = toRadians(from.latitude);
lon1r = toRadians(from.longitude);
lat2r = toRadians(to.latitude);
lon2r = toRadians(to.longitude);
u = sin((lat2r - lat1r) / 2);
v = sin((lon2r - lon1r) / 2);
return 2.0 * EARTH_M * asin(sqrt(u * u + cos(lat1r) * cos(lat2r) * v * v));
}
// Input and Output in degrees
static inline struct point calculatePointDD(struct point coordinates,
double bearing,