EphCore.Geometry.Horizontal (eph_core v0.1.0)

Copy Markdown View Source

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

local_basis()

@type local_basis() :: %{
  east: AstroUtils.Vector.t(),
  north: AstroUtils.Vector.t(),
  up: AstroUtils.Vector.t()
}

Functions

alt_az_from_direction(direction, local_basis)

@spec alt_az_from_direction(AstroUtils.Vector.t(), local_basis()) ::
  {float(), float()}

local_basis(lat_deg, lon_deg, ecef_to_inertial)

@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.