CelestialCalendar 1.0.0 · unreleased development @ 67a7c4c79a4a4a6aa7e703c9e6f0039ae34bee82
Loading...
Searching...
No Matches
planet_phenomena.hpp File Reference
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <format>
#include <numeric>
#include <ranges>
#include <stdexcept>
#include <vector>
#include "datetime.hpp"
#include "illumination.hpp"
#include "julian_day.hpp"
#include "planet.hpp"
#include "sun.hpp"
#include "toolbox.hpp"
#include "ymd.hpp"

Classes

struct  astro::planet::phenomena::Event
 A planetary event and its TT-scale instant. More...
struct  astro::planet::phenomena::detail::Sample
 Solver samples in degrees; samples() lifts longitude and difference continuously across the grid. More...
struct  astro::planet::phenomena::detail::SamplingWindow
struct  astro::planet::phenomena::detail::CrossingSpec

Namespaces

namespace  astro
namespace  astro::planet
namespace  astro::planet::phenomena
namespace  astro::planet::phenomena::detail

Enumerations

enum class  astro::planet::phenomena::Kind : uint8_t {
  astro::planet::phenomena::INFERIOR_CONJUNCTION , astro::planet::phenomena::SUPERIOR_CONJUNCTION , astro::planet::phenomena::CONJUNCTION , astro::planet::phenomena::OPPOSITION ,
  astro::planet::phenomena::EASTERN_QUADRATURE , astro::planet::phenomena::WESTERN_QUADRATURE , astro::planet::phenomena::GREATEST_EASTERN_ELONGATION , astro::planet::phenomena::GREATEST_WESTERN_ELONGATION ,
  astro::planet::phenomena::STATION_RETROGRADE , astro::planet::phenomena::STATION_DIRECT
}
 An observer-facing planetary event. More...
enum class  astro::planet::phenomena::detail::Category : uint8_t { astro::planet::phenomena::detail::INNER , astro::planet::phenomena::detail::OUTER }

Functions

auto astro::planet::phenomena::detail::category (const Planet planet) -> Category
 Select the inner/outer event family, rejecting unnamed planets.
auto astro::planet::phenomena::detail::raw_difference (const toolbox::SphericalCoordinate &source, const toolbox::SphericalCoordinate &target) -> double
 Hand over target-minus-source longitude to the scalar solvers as IEEE-remainder degrees.
auto astro::planet::phenomena::detail::raw_difference (const Planet planet, const double jde_tt) -> double
 Evaluate apparent planet-minus-Sun longitude in degrees at JDE(TT).
auto astro::planet::phenomena::detail::sample (const Planet planet, const double jde_tt) -> Sample
 Evaluate longitude, planet-minus-Sun difference and great-circle separation at JDE(TT).
auto astro::planet::phenomena::detail::samples (const Planet planet, const SamplingWindow window) -> std::vector< Sample >
 Sample a padded absolute TT lattice, lifting each angle relative to the preceding sample.
auto astro::planet::phenomena::detail::refine_crossing (const Planet planet, const Sample &left_sample, const Sample &right_sample, const CrossingSpec spec) -> double
 Bisect a lifted longitude crossing until both the degree residual and TT bracket width pass.
template<typename Objective>
auto astro::planet::phenomena::detail::refine_extremum (const Planet planet, const double left_jde_tt, const double right_jde_tt, const bool maximize, const Objective &objective) -> double
 Contract an extremum bracket in TT, then require a strict two-sided objective witness.
auto astro::planet::phenomena::detail::crossing_samples (const Planet planet, const std::vector< Sample > &grid) -> std::vector< Sample >
 Insert refined reversals of the lifted difference so a coarse interval can expose two crossings.
auto astro::planet::phenomena::detail::outer_kind (const int64_t level_index) -> Kind
 Map an unwrapped 90-degree level index to the outer planet's event kind.
auto astro::planet::phenomena::detail::append_crossings (const Planet planet, const Category planet_category, const std::vector< Sample > &grid, std::vector< Event > &result) -> void
 Append longitude crossings in grid order; the caller later combines them with extrema.
auto astro::planet::phenomena::detail::append_extrema (const Planet planet, const Category planet_category, const std::vector< Sample > &grid, std::vector< Event > &result) -> void
 Append separation maxima and lifted-longitude turns, not zeros of the seven-point rate.
auto astro::planet::phenomena::detail::in_year (const double jde_tt, const double start_jde_tt, const double end_jde_tt) -> bool
 Test ownership in the UTC year's half-open JDE(TT) window.
auto astro::planet::phenomena::detail::search (const Planet planet, const double start_jde_tt, const double end_jde_tt, const double step_days) -> std::vector< Event >
 Combine annual event candidates, retain query-owned times and deduplicate consecutive same-kind events.
auto astro::planet::phenomena::events (const Planet planet, const int32_t year) -> std::vector< Event >
 Find all applicable observer-facing events for a planet in a Gregorian year.

Variables

constexpr double astro::planet::phenomena::detail::COARSE_STEP_DAYS
constexpr double astro::planet::phenomena::detail::TIME_TOLERANCE_DAYS
constexpr double astro::planet::phenomena::detail::ANGLE_RESIDUAL_TOLERANCE_DEG
constexpr double astro::planet::phenomena::detail::WITNESS_HALF_WIDTH_DAYS
constexpr double astro::planet::phenomena::detail::DEDUPLICATION_TOLERANCE_DAYS
constexpr std::size_t astro::planet::phenomena::detail::MAX_REFINEMENT_ITERATIONS
constexpr int32_t astro::planet::phenomena::detail::PLUTO_EVENT_START_YEAR
constexpr int32_t astro::planet::phenomena::detail::PLUTO_EVENT_END_YEAR