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

Classes

struct  Algo1Coefficients
 The coefficients of algorithm 1. More...

Functions

constexpr auto find_coefficients (const int32_t year) -> std::optional< std::pair< Algo1Coefficients, Algo1Coefficients > >
 Get the coefficients of algorithm 1. Returns std::nullopt if not found.
constexpr auto compute (const double year) -> double
 Compute ΔT for a decimal Gregorian year using algorithm 1.

Variables

constexpr double MINIMUM_YEAR
constexpr std::array< Algo1Coefficients, 20 > ALGO1_COEFFICIENTS

Function Documentation

◆ compute()

auto astro::delta_t::algo1::compute ( const double year) ->double
nodiscardconstexpr

Compute ΔT for a decimal Gregorian year using algorithm 1.

Parameters
yearThe year, of double type.
Returns
ΔT in seconds.
Exceptions
std::invalid_argumentif the year is < -4000 or not finite.
Example
compute(2005.99999999....) returns ΔT for the last moment of year 2005.
Example
compute(1984.0) returns ΔT for the first moment of year 1984.
See also
Xu Jianwei, 寿星万年历2008版(V1.3.2) - https://web.archive.org/web/20080919020456id_/http://www.fjptsz.com/xxjs/xjw/rj/115.htm
Note
The original algorithm takes integers as input. But I am using doubles here, with the hope of getting more accurate results.
Frozen comparison model.

◆ find_coefficients()

auto astro::delta_t::algo1::find_coefficients ( const int32_t year) ->std::optional< std::pair< Algo1Coefficients, Algo1Coefficients > >
constexpr

Get the coefficients of algorithm 1. Returns std::nullopt if not found.

Variable Documentation

◆ ALGO1_COEFFICIENTS

std::array<Algo1Coefficients, 20> astro::delta_t::algo1::ALGO1_COEFFICIENTS
inlineconstexpr

◆ MINIMUM_YEAR

double astro::delta_t::algo1::MINIMUM_YEAR
inlineconstexpr