20 std::printf(
"=== Coordinate Systems Example ===\n\n");
23 auto jd = JulianDate::from_utc({2026, 7, 15, 22, 0, 0});
25 std::printf(
"Observer (Geodetic): lon=%.4f deg lat=%.4f deg h=%.1f m\n",
26 obs.lon.value(), obs.lat.value(), obs.height.value());
28 auto ecef_m = obs.to_cartesian<qtty::Meter>();
29 auto ecef_km = obs.to_cartesian<qtty::Kilometer>();
30 std::printf(
"Observer (ECEF): x=%.2f m y=%.2f m z=%.2f m\n",
31 ecef_m.x().value(), ecef_m.y().value(), ecef_m.z().value());
32 std::printf(
"Observer (ECEF): x=%.2f km y=%.2f km z=%.2f km\n\n",
33 ecef_km.x().value(), ecef_km.y().value(), ecef_km.z().value());
42 auto vega_back = vega_ecl.to<
ICRS>(jd);
44 std::printf(
"Vega ICRS: RA=%.6f Dec=%.6f\n",
45 vega_icrs.
ra().value(), vega_icrs.
dec().value());
46 std::printf(
"Vega EclipticMeanJ2000: lon=%.6f lat=%.6f\n",
47 vega_ecl.lon().value(), vega_ecl.lat().value());
48 std::printf(
"Vega EquatorialMeanOfDate: RA=%.6f Dec=%.6f\n",
49 vega_eq_mod.ra().value(), vega_eq_mod.dec().value());
50 std::printf(
"Vega EquatorialTrueOfDate: RA=%.6f Dec=%.6f\n",
51 vega_eq_tod.ra().value(), vega_eq_tod.dec().value());
52 std::printf(
"Vega Horizontal: az=%.6f alt=%.6f\n",
53 vega_hor.az().value(), vega_hor.alt().value());
54 std::printf(
"Vega roundtrip ICRS<-Ecliptic: RA=%.6f Dec=%.6f\n\n",
55 vega_back.ra().value(), vega_back.dec().value());
58 120.0_deg, -25.0_deg, 2.0_au);
59 auto target_dir = target_sph_au.
direction();
60 std::printf(
"Spherical ICRS position: RA=%.2f Dec=%.2f dist=%.3f AU\n",
61 target_sph_au.
ra().value(),
62 target_sph_au.
dec().value(),
64 std::printf(
"Direction extracted from spherical position: RA=%.2f Dec=%.2f\n\n",
65 target_dir.ra().value(), target_dir.dec().value());
69 target_cart_m.
x().to<qtty::AstronomicalUnit>(),
70 target_cart_m.
y().to<qtty::AstronomicalUnit>(),
71 target_cart_m.
z().to<qtty::AstronomicalUnit>());
73 std::printf(
"Cartesian ICRS position: x=%.3e m y=%.3e m z=%.3e m\n",
74 target_cart_m.
x().value(),
75 target_cart_m.
y().value(),
76 target_cart_m.
z().value());
77 std::printf(
"Cartesian ICRS position: x=%.6f AU y=%.6f AU z=%.6f AU\n",
78 target_cart_au.
x().value(),
79 target_cart_au.
y().value(),
80 target_cart_au.
z().value());
std::enable_if_t< frames::has_horizontal_transform_v< F_ >, Direction< frames::Horizontal > > to_horizontal(const JulianDate &jd, const Geodetic &observer) const
Transform to the horizontal (alt-az) frame.