1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright (C) 2026 Vallés Puig, Ramon
//! # Lunar surface Alt/Az quickstart (no downloads)
//!
//! This is the smallest useful body-surface example. It answers:
//! “From a site on the Moon, where is a fixed sky direction right now?”
//!
//! ## Concepts (in order)
//!
//! 1. **Observer site** — a longitude, latitude, and height on the Moon’s
//! reference sphere (`SurfaceSite::<Moon>`). Longitude is east-positive;
//! latitude is planetocentric on the IAU 1737.4 km sphere.
//! 2. **ICRS** — the inertial celestial reference system (quasar-fixed axes).
//! A star catalogue direction is naturally an ICRS unit vector.
//! 3. **Direction** — a unit vector with **no distance**. Parallax is therefore
//! not invented; only the orientation of the Moon matters.
//! 4. **Epoch** — the observation time as a TT Julian Date (`J2000` here).
//! Lunar orientation is evaluated in TDB via tempoch’s TT→TDB conversion.
//! 5. **Altitude / azimuth** — geometric horizon angles at the site
//! (alt = 0° on the horizon, +90° at zenith; az = 0° north, 90° east).
//! 6. **`AstroContext`** — carries ephemeris / EOP providers used by frame
//! rotations. `Default` is enough for this geometric demo.
//!
//! Orientation model: NAIF `IAU_MOON` analytical Mean-Earth
//! (`MoonIauMeanEarth`), **not** a JPL DE `MOON_PA` kernel.
//! Results are **geometric**, not apparent (no refraction, aberration,
//! light-time, or terrain).
//!
//! ```text
//! cargo run --example 22_moon_surface_quickstart
//! ```
//!
//! Representative output (deterministic for this fixed site, direction, and
//! J2000 TT epoch; values change only if the lunar orientation model changes):
//! ```text
//! Lunar site: lon=20 °, lat=-3.5 °
//! Geometric Alt/Az at J2000 TT: alt=17.765928422856998 °, az=12.045094675187446 ° (N=0°, E=90°)
//! ```
use Moon;
use Direction;
use ICRS;
use SurfaceSite;
use ;
use ;
use J2000;