fix(cockpit): no swath readout while the orbital view looks past the Earth's limb

This commit is contained in:
Sameh Khamis committed 2026-11-08 15:55:02 -08:00
1 parent 5c25bc54e6
commit 6ca53febad
3 files changed
+37 -4

No files matched your search

+15
View File
@@ -364,6 +364,21 @@ export function offNadirAngleDeg({ northDeg = 0, eastDeg = 0 } = {}) {
return (Math.acos(cosine) * 180) / Math.PI;
}
/**
* Whether the view's centre, tilted off nadir, still meets the Earth: its
* angle from nadir (`offNadirAngleDeg`) is within the Earth's angular radius
* from the satellite, asin(R / (R + altitude)).
* @param {number} altitudeM
* @param {{northDeg?: number, eastDeg?: number}} [offset]
* @returns {boolean}
*/
export function offNadirCentreMeetsEarth(altitudeM, offset = {}) {
if (!Number.isFinite(altitudeM) || altitudeM <= 0) return false;
const R = ORBITAL_EARTH_RADIUS_M;
const limbDeg = (Math.asin(R / (R + altitudeM)) * 180) / Math.PI;
return offNadirAngleDeg(offset) < limbDeg;
}
/**
* Roughly how much wider the ground across the frame is at the centre of a
* tilted view than at nadir, on a flat Earth: tilting across the frame (east,