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

Namespaces

namespace  detail

Classes

struct  JieqiGenerator
 A generator that generates consecutive Jieqis and their moments (in JDE), starting from a given JDE (exclusive). More...

Enumerations

enum class  Jieqi : uint8_t {
  立春 , 雨水 , 惊蛰 , 春分 ,
  清明 , 谷雨 , 立夏 , 小满 ,
  芒种 , 夏至 , 小暑 , 大暑 ,
  立秋 , 处暑 , 白露 , 秋分 ,
  寒露 , 霜降 , 立冬 , 小雪 ,
  大雪 , 冬至 , 小寒 , 大寒 ,
  COUNT , LICHUN , YUSHUI , JINGZHE ,
  CHUNFEN , QINGMING , GUYU , LIXIA ,
  XIAOMAN , MANGZHONG , XIAZHI , XIAOSHU ,
  DASHU , LIQIU , CHUSHU , BAILU ,
  QIUFEN , HANLU , SHUANGJIANG , LIDONG ,
  XIAOXUE , DAXUE , DONGZHI , XIAOHAN ,
  DAHAN
}
 The Chinese Jieqi (节气). More...

Functions

constexpr auto is_jie (const Jieqi jq) -> bool
 Check if the given jq is a Jie (节).
constexpr auto is_qi (const Jieqi jq) -> bool
 Check if the given jq is a Qi (气).
constexpr auto to_index (const Jieqi jq) -> uint8_t
 Get the index of the given jq.
constexpr auto from_index (const uint8_t index) -> Jieqi
 Get the Jieqi at a 0-based index counted from 立春.
constexpr auto name_of (const Jieqi jq) -> std::string_view
 Get the name of the given jq.
constexpr auto longitude_of (const Jieqi jq) -> double
 Get the solar longitude (in degrees) at which the given jq begins.
auto calc_jieqi_jde (const int32_t year, const Jieqi jq) -> double
 Get the JDE for the given year and jieqi.
auto jieqi_jde (const int32_t year, const Jieqi jq) -> double
 Get the JDE for the given year and jieqi, using cache.
auto jieqi_ut1_moment (const int32_t year, const Jieqi jq) -> calendar::Datetime
 Get the UT1 moment of the given year and jieqi.

Variables

constexpr uint8_t JIEQI_COUNT
constexpr auto JIEQI_LIST
 A view of all enum values of Jieqi.
constexpr auto GREGORIAN_YEAR_JIEQI_LIST
 Jieqi in Gregorian calendar order, beginning with 小寒.
constexpr std::array< std::string_view, JIEQI_COUNT > JIEQI_NAME
 Name of each Jieqi, positioned by to_index.
constexpr std::array< double, JIEQI_COUNT > JIEQI_SOLAR_LONGITUDE
 Solar longitude (in degrees) at which each Jieqi begins, positioned by to_index.

Enumeration Type Documentation

◆ Jieqi

enum class calendar::jieqi::Jieqi : uint8_t
strong

The Chinese Jieqi (节气).

Enumerator
立春 
雨水 
惊蛰 
春分 
清明 
谷雨 
立夏 
小满 
芒种 
夏至 
小暑 
大暑 
立秋 
处暑 
白露 
秋分 
寒露 
霜降 
立冬 
小雪 
大雪 
冬至 
小寒 
大寒 
COUNT 
LICHUN 
YUSHUI 
JINGZHE 
CHUNFEN 
QINGMING 
GUYU 
LIXIA 
XIAOMAN 
MANGZHONG 
XIAZHI 
XIAOSHU 
DASHU 
LIQIU 
CHUSHU 
BAILU 
QIUFEN 
HANLU 
SHUANGJIANG 
LIDONG 
XIAOXUE 
DAXUE 
DONGZHI 
XIAOHAN 
DAHAN 

Function Documentation

◆ calc_jieqi_jde()

auto calendar::jieqi::calc_jieqi_jde ( const int32_t year,
const Jieqi jq )->double
inlinenodiscard

Get the JDE for the given year and jieqi.

Parameters
yearThe gregorian year, in [1, 32766].
jqThe jieqi.
Returns
The JDE (Julian Ephemeris Day).
Exceptions
std::invalid_argumentif year is outside [1, 32766], or jq is not a valid Jieqi.
std::runtime_errorif the root search does not yield exactly one root.

◆ from_index()

auto calendar::jieqi::from_index ( const uint8_t index) ->Jieqi
nodiscardconstexpr

Get the Jieqi at a 0-based index counted from 立春.

Parameters
indexThe index, in [0, JIEQI_COUNT).
Returns
The jieqi.
Exceptions
std::invalid_argumentif index is not a valid index.

◆ is_jie()

auto calendar::jieqi::is_jie ( const Jieqi jq) ->bool
nodiscardconstexpr

Check if the given jq is a Jie (节).

Parameters
jqThe jieqi.
Returns
true if the given jq is a Jie (节), false otherwise.

◆ is_qi()

auto calendar::jieqi::is_qi ( const Jieqi jq) ->bool
nodiscardconstexpr

Check if the given jq is a Qi (气).

Parameters
jqThe jieqi.
Returns
true if the given jq is a Qi (气), false otherwise.

◆ jieqi_jde()

auto calendar::jieqi::jieqi_jde ( const int32_t year,
const Jieqi jq )->double
inlinenodiscard

Get the JDE for the given year and jieqi, using cache.

Parameters
yearThe gregorian year, in [1, 32766].
jqThe jieqi.
Returns
The JDE (Julian Ephemeris Day).
Exceptions
std::invalid_argumentif year is outside [1, 32766], or jq is not a valid Jieqi.
std::runtime_errorif the root search does not yield exactly one root.

◆ jieqi_ut1_moment()

auto calendar::jieqi::jieqi_ut1_moment ( const int32_t year,
const Jieqi jq )->calendar::Datetime
inlinenodiscard

Get the UT1 moment of the given year and jieqi.

Parameters
yearThe gregorian year, in [401, 32766].
jqThe jieqi.
Returns
The UT1 (Universal Time 1).
Exceptions
std::invalid_argumentif year is outside [401, 32766], or jq is not a valid Jieqi.
std::runtime_errorif the root search does not yield exactly one root.
Note
UT1, not UTC — the lunar-calendar rules render civil moments through the leap-second-aware path instead (#84). Remaining consumers: the C-ABI query_jieqi_moment (contract: celestial.h) and the HKO golden axis; UT1 stays for contract stability. While leap seconds are applied, |UT1 − UTC| < 0.9 s; past the last ΔAT table step the modelled UT1 − UTC is (ΔAT + 32.184 s) − ΔT, no longer bounded by 0.9 s (#115). The gap by era: docs/DESIGN.md#time-scales.
The returned date is not an east-eight wall date; rendering the same instant at a fixed UTC+8 offset can change its calendar date.

◆ longitude_of()

auto calendar::jieqi::longitude_of ( const Jieqi jq) ->double
nodiscardconstexpr

Get the solar longitude (in degrees) at which the given jq begins.

Parameters
jqThe jieqi.
Returns
The solar longitude.
Exceptions
std::invalid_argumentif jq is not a valid Jieqi.

◆ name_of()

auto calendar::jieqi::name_of ( const Jieqi jq) ->std::string_view
nodiscardconstexpr

Get the name of the given jq.

Parameters
jqThe jieqi.
Returns
The name.
Exceptions
std::invalid_argumentif jq is not a valid Jieqi.

◆ to_index()

auto calendar::jieqi::to_index ( const Jieqi jq) ->uint8_t
nodiscardconstexpr

Get the index of the given jq.

Parameters
jqThe jieqi.
Returns
The index of the given jq.

Variable Documentation

◆ GREGORIAN_YEAR_JIEQI_LIST

auto calendar::jieqi::GREGORIAN_YEAR_JIEQI_LIST
inlineconstexpr

Jieqi in Gregorian calendar order, beginning with 小寒.

Note
This is calendar order; computed roots are not assumed to be chronological.

◆ JIEQI_COUNT

uint8_t calendar::jieqi::JIEQI_COUNT
inlineconstexpr

◆ JIEQI_LIST

auto calendar::jieqi::JIEQI_LIST
inlineconstexpr

A view of all enum values of Jieqi.

◆ JIEQI_NAME

std::array<std::string_view, JIEQI_COUNT> calendar::jieqi::JIEQI_NAME
inlineconstexpr

Name of each Jieqi, positioned by to_index.

Note
Read it through name_of – a bare index cannot say which space it came from. See name_of.

◆ JIEQI_SOLAR_LONGITUDE

std::array<double, JIEQI_COUNT> calendar::jieqi::JIEQI_SOLAR_LONGITUDE
inlineconstexpr

Solar longitude (in degrees) at which each Jieqi begins, positioned by to_index.

Note
Read it through longitude_of – see name_of.