mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
feat: add aviation and satellite tools
Add aircraft_in_area, find_aircraft, get_aircraft_track and get_aircraft_info over the live aircraft sources, with an optional military feed, and next_satellite_pass and satellites_overhead over the satellite catalog and the existing pass predictor. Source failures from the live contract now become tool errors with the matching code, so a rate limit reaches clients as retry_later with a wait time. Tool schemas may use pattern.
This commit is contained in:
1 parent
9895942633
commit
22c3fe40b0
16 files changed
+1111
-16
No files matched your search
@@ -104,6 +104,20 @@ export function distanceKm(a, b) {
|
||||
return 2 * EARTH_RADIUS_KM * Math.asin(Math.min(1, Math.sqrt(h)));
|
||||
}
|
||||
|
||||
/** The center of a resolved area, handling boxes across the antimeridian. */
|
||||
export function areaCenter(area) {
|
||||
if (area.center) return { lat: area.center.lat, lon: area.center.lon };
|
||||
const width =
|
||||
area.west <= area.east
|
||||
? area.east - area.west
|
||||
: area.east + 360 - area.west;
|
||||
const lon = area.west + width / 2;
|
||||
return {
|
||||
lat: (area.south + area.north) / 2,
|
||||
lon: lon > 180 ? lon - 360 : lon,
|
||||
};
|
||||
}
|
||||
|
||||
/** Whether a point lies inside a resolved area, including radius areas. */
|
||||
export function areaContains(area, point) {
|
||||
if (!Number.isFinite(point?.lat) || !Number.isFinite(point?.lon))
|
||||
|
||||
Reference in new issue
Block a user