This commit is contained in:
2026-06-07 12:50:04 +02:00
parent eb64b8f2f9
commit 9189f54df5
7 changed files with 126 additions and 9 deletions
+10
View File
@@ -77,6 +77,16 @@ export function pathBetween(fromGrid: string, toGrid: string): PathInfo | null {
const a = gridToLatLon(fromGrid);
const b = gridToLatLon(toGrid);
if (!a || !b) return null;
return pathBetweenLatLon(a, b);
}
// pathBetweenLatLon computes the great-circle path between two lat/lon points.
// Used as a fallback when a station has a known location (e.g. cty.dat entity
// coordinates for Svalbard) but no Maidenhead grid.
export function pathBetweenLatLon(
a: { lat: number; lon: number },
b: { lat: number; lon: number },
): PathInfo {
const φ1 = toRad(a.lat);
const φ2 = toRad(b.lat);
const Δλ = toRad(b.lon - a.lon);