CelestialCalendar 1.0.0 · unreleased development @ 67a7c4c79a4a4a6aa7e703c9e6f0039ae34bee82
Loading...
Searching...
No Matches
ephemeris.hpp File Reference
#include <algorithm>
#include <array>
#include <cmath>
#include <concepts>
#include <cstddef>
#include <cstdint>
#include <format>
#include <functional>
#include <limits>
#include <optional>
#include <stdexcept>
#include <type_traits>
#include <utility>
#include "coord_transform.hpp"
#include "earth.hpp"
#include "julian_day.hpp"
#include "lunar_node.hpp"
#include "moon.hpp"
#include "planet.hpp"
#include "sun.hpp"

Classes

struct  astro::ephemeris::TargetFacts
 Target identity and provider domains; rate_node preserves the paired ascending trajectory. More...
struct  astro::ephemeris::Position
 Apparent geocentric coordinates in the true ecliptic and equinox of date. More...
struct  astro::ephemeris::EquatorialPosition
 Apparent geocentric equatorial coordinates of date; nodes have no physical distance. More...
struct  astro::ephemeris::LongitudeRate
 A signed instantaneous longitude rate; a negative value means longitude is decreasing at that instant. More...

Namespaces

namespace  astro
namespace  astro::ephemeris
namespace  astro::ephemeris::detail

Enumerations

enum class  astro::ephemeris::Target : uint8_t {
  astro::ephemeris::SUN , astro::ephemeris::MOON , astro::ephemeris::MERCURY , astro::ephemeris::VENUS ,
  astro::ephemeris::MARS , astro::ephemeris::JUPITER , astro::ephemeris::SATURN , astro::ephemeris::URANUS ,
  astro::ephemeris::NEPTUNE , astro::ephemeris::PLUTO , astro::ephemeris::MEAN_ASCENDING , astro::ephemeris::MEAN_DESCENDING ,
  astro::ephemeris::TRUE_ASCENDING , astro::ephemeris::TRUE_DESCENDING
}
 A body or lunar node. More...
enum class  astro::ephemeris::PositionSource : uint8_t {
  astro::ephemeris::SUN_VSOP87D , astro::ephemeris::MOON_ELP2000_82B_TRUNC , astro::ephemeris::PLANET_VSOP87D , astro::ephemeris::PLUTO_PLUTO95_APPARENT ,
  astro::ephemeris::NODE_MEAN , astro::ephemeris::NODE_TRUE_MEEUS_FIVE_TERM
}
 The computation supplying a target's apparent position. More...
enum class  astro::ephemeris::DomainOrigin : uint8_t { astro::ephemeris::SOURCE , astro::ephemeris::IMPLEMENTATION }
 Origin of a bounded position domain; ignored when no position domain is declared. More...

Functions

constexpr auto astro::ephemeris::is_target (const Target target) -> bool
 Recognize named Target values; new distinct enumerators must also enter TARGET_FACTS.
constexpr auto astro::ephemeris::detail::consistent_provider (const TargetFacts &facts) -> bool
 Keep each source's dispatch operands consistent before any runtime lookup.
consteval auto astro::ephemeris::detail::complete_target_facts () -> bool
 Check membership, provider operands and shared-source windows; enum aliases are indistinguishable.
constexpr auto astro::ephemeris::target_facts (const Target target) -> const TargetFacts &
 Look up a named target; unknown values are invalid arguments.
constexpr auto astro::ephemeris::source_of (const Target target) -> PositionSource
 The source of a named target's apparent position.
constexpr auto astro::ephemeris::position_domain (const Target target) -> std::optional< std::array< double, 2 > >
 Half-open provider domain, or no hard interval; neither implies accuracy or successful evaluation.
auto astro::ephemeris::detail::physical_apparent (const TargetFacts &facts, const double jde_tt) -> toolbox::SphericalCoordinate
 Return an apparent geocentric ecliptic position, including AU distance.
auto astro::ephemeris::detail::longitude_for_rate (const Target target, const double jde_tt) -> toolbox::AngleDeg
 Evaluate apparent longitude at JDE(TT); descending nodes use the paired ascending rate trajectory.
auto astro::ephemeris::detail::validate_position (const Position &coordinate) -> void
 Reject impossible computed coordinates without clamping latitude or distance.
auto astro::ephemeris::detail::validate_stencil (const double jde_tt) -> void
 Require finite JDE(TT) and exact representability of all six binary-offset sample times.
auto astro::ephemeris::detail::validate_reach (const double jde_tt, const double start_jde_tt, const double end_jde_tt) -> void
 Require the whole ±3/8-day stencil to remain inside the provider's half-open TT domain.
auto astro::ephemeris::detail::validate_rate_input (const Target target, const double jde_tt) -> void
 Validate sample representability before identity and the source's sampling reach.
template<typename LongitudeProvider>
requires std::invocable<const LongitudeProvider&, double> and std::same_as<std::invoke_result_t<const LongitudeProvider&, double>, toolbox::AngleDeg>
auto astro::ephemeris::detail::differentiate (const LongitudeProvider &longitude, const double jde_tt) -> LongitudeRate
 Evaluate the seven-point centered longitude rate, in degrees per TT day.
auto astro::ephemeris::position (const Target target, const double jde_tt) -> Position
 Evaluate one target's apparent position without a rate stencil or civil policy.
auto astro::ephemeris::equatorial_position (const Target target, const double jde_tt) -> EquatorialPosition
 Project one apparent ecliptic position to geocentric apparent RA/Dec of date.
constexpr auto astro::ephemeris::longitude_rate_domain (const Target target) -> std::array< double, 2 >
 Return the half-open center domain of a target's longitude-rate operation.
auto astro::ephemeris::longitude_rate (const Target target, const double jde_tt) -> LongitudeRate
 Instantaneous geocentric longitude rate using the target's position model.

Variables

constexpr auto astro::ephemeris::TARGET_FACTS
 Target facts in chart order; absent position domains admit finite-input evaluation, which may fail.
constexpr auto astro::ephemeris::TARGETS
 The target roster, derived from the facts table in chart order.
constexpr double astro::ephemeris::detail::DIFFERENCE_STEP_TT_DAYS
constexpr double astro::ephemeris::detail::DIFFERENCE_REACH_TT_DAYS