|
CelestialCalendar 1.0.0 · unreleased development @ 67a7c4c79a4a4a6aa7e703c9e6f0039ae34bee82
|
Namespaces | |
| namespace | literals |
Classes | |
| struct | Angle |
| Represents an angle. More... | |
| struct | Distance |
| Represents a distance. More... | |
| struct | SphericalCoordinate |
| Represents a position in a spherical coordinate system. More... | |
| struct | GoldenSectionRules |
| Arithmetic, comparison and stopping rules supplied by an extremum-search caller. More... | |
| struct | GoldenSectionBracket |
| The final bracket; converged is false when the update budget runs out. More... | |
Typedefs | |
| using | AngleDeg |
| An angle measured in degrees. | |
| using | AngleRad |
| using | DistanceAu |
| A distance measured in astronomical units; see AngleDeg for the alias convention. | |
| using | DistanceKm |
Enumerations | |
| enum class | AngleUnit : uint8_t { RAD , DEG } |
| enum class | DistanceUnit : uint8_t { AU , KM } |
| The unit of distance, either AU or KM. More... | |
Functions | |
| constexpr auto | normalize_deg (const double deg) -> double |
| Normalize degree to [0, 360). | |
| constexpr auto | normalize_rad (const double rad) -> double |
| Normalize radian to [0, 2π). | |
| constexpr auto | normalize_pm180 (const double deg) -> double |
| Normalize degree to [-180, 180). Useful for hour angles, where sign carries meaning. | |
| auto | remainder_deg (const double difference_deg) -> double |
| Return the IEEE remainder in [-180°, 180°], retaining signed zero and either sign at 180°. | |
| auto | unwrap_near (const double wrapped_deg, const double reference_deg) -> double |
| Shift an angle by whole turns toward a reference, without normalizing either input. | |
| constexpr auto | deg_to_rad (const double deg) -> double |
| Convert degree to radian. | |
| constexpr auto | rad_to_deg (const double rad) -> double |
| Convert radian to degree. | |
| constexpr auto | arcmin_to_deg (const double arcmin) -> double |
| Convert minutes to degrees. | |
| constexpr auto | arcsec_to_deg (const double arcsec) -> double |
| Convert seconds to degrees. | |
| auto | canonical_longitude_difference (const AngleDeg difference) -> AngleDeg |
| Canonicalize a finite directed longitude difference to (-180, 180] degrees. | |
| constexpr auto | au_to_km (const double au) -> double |
| Convert from AU to KM. | |
| constexpr auto | km_to_au (const double km) -> double |
| Convert from KM to AU. | |
| auto | ulp (const double x) -> double |
| The gap between x and the next representable double — one unit in the last place. | |
| template<typename Func> requires std::invocable<const Func&, double> and std::convertible_to<std::invoke_result_t<const Func&, double>, double> | |
| auto | newton_method (const Func &f, const double start_jde, const double end_jde, const double mean_rate_deg_per_day, const std::size_t max_iterations=NEWTON_MAX_ITERATIONS) -> double |
| Apply Newton's method to find the JDE at which f crosses zero. | |
| template<typename Func, typename Rules> requires std::invocable<const Func&, double> and std::convertible_to<std::invoke_result_t<const Func&, double>, double> | |
| auto | golden_section_bracket (const Func &f, const double lower, const double upper, const double tolerance, const std::size_t maximum_updates, const Rules &rules) -> GoldenSectionBracket |
| Contract a unimodal bracket using the caller's numerical rules. | |
Variables | |
| constexpr double | DEG_PER_RAD |
| The number of degrees in a radian. | |
| constexpr double | LONGITUDE_PERIOD_DEG |
| The angular period of an ecliptic longitude, in degrees. | |
| constexpr double | SIDEREAL_RATE_DEG_PER_DAY |
| The mean angular rate of Earth's rotation relative to the stars, in degrees per day. Used to convert between time offsets and hour angle offsets. | |
| constexpr double | SOLAR_MEAN_MOTION_DEG_PER_DAY |
| The Sun's mean apparent motion along the ecliptic, in degrees per day. A tropical year of 365.2422 days carries it through a full 360°. | |
| constexpr double | MOON_ELONGATION_RATE_DEG_PER_DAY |
| The mean rate at which the Moon's apparent longitude pulls away from the Sun's, in degrees per day. A synodic month of 29.530588853 days closes a full 360°. | |
| constexpr uint32_t | MIN_PER_DEG |
| The number of minutes in a degree. | |
| constexpr uint32_t | SEC_PER_MIN |
| The number of seconds in a minute. | |
| constexpr uint32_t | SEC_PER_DEG |
| The number of seconds in a degree. | |
| constexpr double | AU_KM_SCALE |
| The scaling factor from AU to KM. | |
| constexpr double | NEWTON_INITIAL_STEP_DAYS |
| The initial half-width of the central difference approximating f', in days. | |
| constexpr double | NEWTON_MIN_STEP_ULP |
| The floor on that half-width, as a multiple of ulp(jde). | |
| constexpr double | NEWTON_RESIDUAL_TOL_ULP |
| The residual tolerance, as a multiple of the angle swept during one ulp(jde). | |
| constexpr std::size_t | NEWTON_MAX_ITERATIONS |
| The Newton iteration budget. | |
| constexpr double | INV_PHI |
| (√5 − 1)/2, rounded directly to binary64. | |
| constexpr double | INV_PHI_SQ |
| (3 − √5)/2, rounded independently of INV_PHI. | |
| using astro::toolbox::AngleDeg |
An angle measured in degrees.
| using astro::toolbox::AngleRad |
A distance measured in astronomical units; see AngleDeg for the alias convention.
|
strong |
|
strong |
|
nodiscardconstexpr |
Convert minutes to degrees.
|
nodiscardconstexpr |
Convert seconds to degrees.
|
nodiscardconstexpr |
Convert from AU to KM.
|
inlinenodiscard |
Canonicalize a finite directed longitude difference to (-180, 180] degrees.
| std::invalid_argument | If the angle is not finite. |
|
nodiscardconstexpr |
Convert degree to radian.
|
inlinenodiscard |
Contract a unimodal bracket using the caller's numerical rules.
| f | The objective, evaluated at two initial probes even when maximum_updates is zero. |
| lower | The initial lower bound. |
| upper | The initial upper bound. |
| tolerance | The width threshold passed to rules.finished. |
| maximum_updates | The contraction budget, excluding the two initial probes. |
| rules | The lower-probe arithmetic, move-lower comparison and width stopping predicate. |
|
nodiscardconstexpr |
Convert from KM to AU.
|
inlinenodiscard |
Apply Newton's method to find the JDE at which f crosses zero.
| f | The function to find the root of. Must be smooth over [start_jde, end_jde) — callers that work with a wrapping angle are responsible for unwrapping it first. |
| start_jde | The left bound of the search, inclusive. |
| end_jde | The right bound of the search, exclusive. |
| mean_rate_deg_per_day | The mean rate at which f sweeps. This sets the scale of the residual tolerance; it is not used as the derivative. |
| max_iterations | The iteration budget. |
|
nodiscardconstexpr |
Normalize degree to [0, 360).
| std::invalid_argument | If deg is not finite — a non-finite angle has no normal form, and returning one would pass it off as already normalized (#88). |
|
nodiscardconstexpr |
Normalize degree to [-180, 180). Useful for hour angles, where sign carries meaning.
| std::invalid_argument | If deg is not finite — inherited from normalize_deg. |
|
nodiscardconstexpr |
Normalize radian to [0, 2π).
| std::invalid_argument | If rad is not finite. |
|
nodiscardconstexpr |
Convert radian to degree.
|
inlinenodiscard |
Return the IEEE remainder in [-180°, 180°], retaining signed zero and either sign at 180°.
|
inlinenodiscard |
The gap between x and the next representable double — one unit in the last place.
| x | The value to measure at. |
|
inlinenodiscard |
Shift an angle by whole turns toward a reference, without normalizing either input.
|
inlineconstexpr |
The scaling factor from AU to KM.
|
inlineconstexpr |
The number of degrees in a radian.
|
inlineconstexpr |
(√5 − 1)/2, rounded directly to binary64.
|
inlineconstexpr |
(3 − √5)/2, rounded independently of INV_PHI.
|
inlineconstexpr |
The angular period of an ecliptic longitude, in degrees.
|
inlineconstexpr |
The number of minutes in a degree.
|
inlineconstexpr |
The mean rate at which the Moon's apparent longitude pulls away from the Sun's, in degrees per day. A synodic month of 29.530588853 days closes a full 360°.
|
inlineconstexpr |
The initial half-width of the central difference approximating f', in days.
|
inlineconstexpr |
The Newton iteration budget.
|
inlineconstexpr |
The floor on that half-width, as a multiple of ulp(jde).
|
inlineconstexpr |
The residual tolerance, as a multiple of the angle swept during one ulp(jde).
|
inlineconstexpr |
The number of seconds in a degree.
|
inlineconstexpr |
The number of seconds in a minute.
|
inlineconstexpr |
The mean angular rate of Earth's rotation relative to the stars, in degrees per day. Used to convert between time offsets and hour angle offsets.
|
inlineconstexpr |
The Sun's mean apparent motion along the ecliptic, in degrees per day. A tropical year of 365.2422 days carries it through a full 360°.