siderust-cpp 0.8.0
Header-only C++ wrapper for siderust
Loading...
Searching...
No Matches
twilight.hpp File Reference

Twilight / darkness phase classification from Sun altitude. More...

#include "ffi_core.hpp"
#include <qtty/qtty.hpp>
Include dependency graph for twilight.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  siderust
 

Enumerations

enum class  siderust::TwilightPhase : int32_t {
  siderust::Day = SIDERUST_TWILIGHT_PHASE_T_DAY , siderust::Civil = SIDERUST_TWILIGHT_PHASE_T_CIVIL , siderust::Nautical = SIDERUST_TWILIGHT_PHASE_T_NAUTICAL , siderust::Astronomical = SIDERUST_TWILIGHT_PHASE_T_ASTRONOMICAL ,
  siderust::Dark = SIDERUST_TWILIGHT_PHASE_T_DARK
}
 Sky-condition phase determined by the Sun's altitude. More...
 

Functions

TwilightPhase siderust::twilight_phase (qtty::Degree altitude)
 Classify the sky condition from the Sun's altitude in degrees.
 
TwilightPhase siderust::twilight_phase (qtty::Radian altitude)
 Classify the sky condition from the Sun's altitude in radians.
 

Detailed Description

Twilight / darkness phase classification from Sun altitude.

Wraps the siderust_twilight_classification_deg and siderust_twilight_classification_rad FFI functions as a single free function twilight_phase() that accepts a qtty::Degree value and returns a typed TwilightPhase enum.

Sky-condition boundaries (IAU/USNO convention)

Phase Sun altitude
Day > 0°
Civil -6° to 0°
Nautical -12° to -6°
Astronomical -18° to -12°
Dark < -18°

Example

auto phase = siderust::twilight_phase(qtty::Degree(-7.5));
// phase == TwilightPhase::Nautical
TwilightPhase twilight_phase(qtty::Degree altitude)
Classify the sky condition from the Sun's altitude in degrees.
Definition twilight.hpp:58
Public siderust time tags and typed time/period aliases.
Twilight / darkness phase classification from Sun altitude.

Definition in file twilight.hpp.