CelestialCalendar 1.0.0 · unreleased development @ 67a7c4c79a4a4a6aa7e703c9e6f0039ae34bee82
Loading...
Searching...
No Matches
astro::solar_time Namespace Reference

Namespaces

namespace  detail

Functions

auto equation_of_time (const double jde_tt) -> toolbox::AngleDeg
 Computes the equation of time E = apparent solar time − mean solar time.
auto apparent (const calendar::Datetime &utc_dt, const toolbox::AngleDeg &longitude) -> calendar::Datetime
 Converts a civil UTC moment to local apparent (true) solar time (真太阳时).

Variables

constexpr double SECONDS_OF_TIME_PER_DEGREE
 Seconds of clock time per degree of hour angle.

Function Documentation

◆ apparent()

auto astro::solar_time::apparent ( const calendar::Datetime & utc_dt,
const toolbox::AngleDeg & longitude )->calendar::Datetime
inlinenodiscard

Converts a civil UTC moment to local apparent (true) solar time (真太阳时).

Parameters
utc_dtThe date and time, in UTC.
longitudeThe observer's geographic longitude, positive east.
Returns
The local apparent solar Datetime: UTC + longitude in time + E.
Exceptions
std::invalid_argumentif longitude is not finite or outside [−180°, 180°]; also propagated from calendar::add_seconds when the shifted result falls outside the representable year range. Invalid pre-1972 datetimes are rejected by astro::julian_day::utc_to_jde.
Note
Apparent solar time follows Earth rotation (UT1); feeding UTC leaves the |UT1 − UTC| < 0.9 s steering gap in the result, and before 1972 the input degrades to UT1 (see astro::leap_second). E is evaluated at the input instant — the output relabels that same physical moment (the up-to-±12 h longitude offset is a label shift, not a time shift), so no fixed-point evaluation is needed.

◆ equation_of_time()

auto astro::solar_time::equation_of_time ( const double jde_tt) ->toolbox::AngleDeg
inlinenodiscard

Computes the equation of time E = apparent solar time − mean solar time.

Parameters
jde_ttThe julian ephemeris day number, which is based on TT.
Returns
E as an angle in [−180°, 180°); multiply by SECONDS_OF_TIME_PER_DEGREE for seconds of time. Positive when the true Sun culminates before mean noon; |E| stays under 5° (20 min of time).

The wrap matters near the equinoxes, where the apparent right ascension α and the mean longitude L0 can sit on opposite sides of the 0°/360° seam.

See also
Jean Meeus, "Astronomical Algorithms", Second Edition, Formula (28.1).

Variable Documentation

◆ SECONDS_OF_TIME_PER_DEGREE

double astro::solar_time::SECONDS_OF_TIME_PER_DEGREE
inlineconstexpr

Seconds of clock time per degree of hour angle.