export function horizonAt(h: Horizon, azDeg: number): number {
const n = h.elev.length;
const x = (((azDeg % 360) + 360) % 360) / h.stepDeg;
const i = Math.floor(x) % n;
const f = x - Math.floor(x);
return h.elev[i] * (1 - f) + h.elev[(i + 1) % n] * f;
}