Helpers for converting direction vectors into local horizon coordinates.
Summary
Functions
Build the local east/north/up basis in the inertial (GCRS/ICRF) frame from a
geodetic lat/lon and the ECEF→inertial rotation matrix.
Types
@type local_basis() :: %{ east: AstroUtils.Vector.t(), north: AstroUtils.Vector.t(), up: AstroUtils.Vector.t() }
Functions
@spec alt_az_from_direction(AstroUtils.Vector.t(), local_basis()) :: {float(), float()}
@spec local_basis(float(), float(), AstroUtils.Matrix3.t()) :: local_basis()
Build the local east/north/up basis in the inertial (GCRS/ICRF) frame from a
geodetic lat/lon and the ECEF→inertial rotation matrix.
up is the ellipsoid normal (the geodetic vertical) rather than the
geocentric radial, so the horizon plane reflects the WGS84 deflection of the
vertical (≈0.1–0.2° at mid-latitudes). Using the radial instead tilts the whole
alt/az frame and produces a systematic ~1–3 min rise/set/transit error.
Shared by EphCore.SnapshotPipeline.ObserverPosition and the almanac
apparent-place pass so both derive alt/az from one definition.