siderust-cpp
Header-only C++ wrapper for siderust
Loading...
Searching...
No Matches
siderust::spherical::Direction< F > Struct Template Reference

A direction on the celestial sphere, compile-time tagged by frame. More...

#include <siderust/coordinates/spherical.hpp>

Public Member Functions

 Direction ()
 
 Direction (qtty::Degree azimuth, qtty::Degree polar)
 
 Direction (double azimuth_deg, double polar_deg)
 Raw-double convenience (degrees).
 
template<typename Target >
std::enable_if_t< frames::has_frame_transform_v< F, Target >, Direction< Target > > to_frame (const JulianDate &jd) const
 Transform to a different reference frame.
 
template<typename Target >
auto to (const JulianDate &jd) const -> decltype(this->template to_frame< Target >(jd))
 Shorthand: .to<Target>(jd) (calls to_frame).
 
template<typename F_ = F>
std::enable_if_t< frames::has_horizontal_transform_v< F_ >, Direction< frames::Horizontal > > to_horizontal (const JulianDate &jd, const Geodetic &observer) const
 Transform to the horizontal (alt-az) frame.
 
RA / Dec (equatorial frames only)
template<typename F_ = F, std::enable_if_t< frames::has_ra_dec_v< F_ >, int > = 0>
qtty::Degree ra () const
 
template<typename F_ = F, std::enable_if_t< frames::has_ra_dec_v< F_ >, int > = 0>
qtty::Degree dec () const
 
Azimuth / Altitude (Horizontal frame only)
template<typename F_ = F, std::enable_if_t< frames::has_az_alt_v< F_ >, int > = 0>
qtty::Degree az () const
 
template<typename F_ = F, std::enable_if_t< frames::has_az_alt_v< F_ >, int > = 0>
qtty::Degree al () const
 
template<typename F_ = F, std::enable_if_t< frames::has_az_alt_v< F_ >, int > = 0>
qtty::Degree alt () const
 
template<typename F_ = F, std::enable_if_t< frames::has_az_alt_v< F_ >, int > = 0>
qtty::Degree altitude () const
 
Longitude / Latitude (lon/lat frames)
template<typename F_ = F, std::enable_if_t< frames::has_lon_lat_v< F_ >, int > = 0>
qtty::Degree lon () const
 
template<typename F_ = F, std::enable_if_t< frames::has_lon_lat_v< F_ >, int > = 0>
qtty::Degree lat () const
 
template<typename F_ = F, std::enable_if_t< frames::has_lon_lat_v< F_ >, int > = 0>
qtty::Degree longitude () const
 
template<typename F_ = F, std::enable_if_t< frames::has_lon_lat_v< F_ >, int > = 0>
qtty::Degree latitude () const
 

Static Public Member Functions

Frame info
static constexpr siderust_frame_t frame_id ()
 
static constexpr const char * frame_name ()
 

FFI interop

siderust_spherical_dir_t to_c () const
 
static Direction from_c (const siderust_spherical_dir_t &c)
 

Detailed Description

template<typename F>
struct siderust::spherical::Direction< F >

A direction on the celestial sphere, compile-time tagged by frame.

Mirrors Rust's affn::spherical::Direction<F>.

Template Parameters
FReference frame tag (e.g. frames::ICRS).
Accessors
Access values through frame-appropriate getters:
Examples
altitude_events_example.cpp, coordinate_systems_example.cpp, coordinates_examples.cpp, and demo.cpp.

Definition at line 36 of file spherical.hpp.

Constructor & Destructor Documentation

◆ Direction() [1/3]

template<typename F >
siderust::spherical::Direction< F >::Direction ( )
inline

Definition at line 44 of file spherical.hpp.

Referenced by siderust::spherical::Direction< F >::from_c().

◆ Direction() [2/3]

template<typename F >
siderust::spherical::Direction< F >::Direction ( qtty::Degree  azimuth,
qtty::Degree  polar 
)
inline

Definition at line 46 of file spherical.hpp.

◆ Direction() [3/3]

template<typename F >
siderust::spherical::Direction< F >::Direction ( double  azimuth_deg,
double  polar_deg 
)
inline

Raw-double convenience (degrees).

Definition at line 50 of file spherical.hpp.

Member Function Documentation

◆ al()

template<typename F >
template<typename F_ = F, std::enable_if_t< frames::has_az_alt_v< F_ >, int > = 0>
qtty::Degree siderust::spherical::Direction< F >::al ( ) const
inline

Definition at line 78 of file spherical.hpp.

◆ alt()

template<typename F >
template<typename F_ = F, std::enable_if_t< frames::has_az_alt_v< F_ >, int > = 0>
qtty::Degree siderust::spherical::Direction< F >::alt ( ) const
inline

Definition at line 81 of file spherical.hpp.

◆ altitude()

template<typename F >
template<typename F_ = F, std::enable_if_t< frames::has_az_alt_v< F_ >, int > = 0>
qtty::Degree siderust::spherical::Direction< F >::altitude ( ) const
inline

Definition at line 84 of file spherical.hpp.

◆ az()

template<typename F >
template<typename F_ = F, std::enable_if_t< frames::has_az_alt_v< F_ >, int > = 0>
qtty::Degree siderust::spherical::Direction< F >::az ( ) const
inline

Definition at line 75 of file spherical.hpp.

◆ dec()

template<typename F >
template<typename F_ = F, std::enable_if_t< frames::has_ra_dec_v< F_ >, int > = 0>
qtty::Degree siderust::spherical::Direction< F >::dec ( ) const
inline
Examples
coordinate_systems_example.cpp, and demo.cpp.

Definition at line 69 of file spherical.hpp.

Referenced by main(), and spherical_direction_example().

◆ frame_id()

template<typename F >
static constexpr siderust_frame_t siderust::spherical::Direction< F >::frame_id ( )
inlinestaticconstexpr

Definition at line 55 of file spherical.hpp.

Referenced by siderust::spherical::Direction< F >::to_c().

◆ frame_name()

template<typename F >
static constexpr const char * siderust::spherical::Direction< F >::frame_name ( )
inlinestaticconstexpr

Definition at line 58 of file spherical.hpp.

◆ from_c()

template<typename F >
static Direction siderust::spherical::Direction< F >::from_c ( const siderust_spherical_dir_t &  c)
inlinestatic

◆ lat()

template<typename F >
template<typename F_ = F, std::enable_if_t< frames::has_lon_lat_v< F_ >, int > = 0>
qtty::Degree siderust::spherical::Direction< F >::lat ( ) const
inline

Definition at line 93 of file spherical.hpp.

◆ latitude()

template<typename F >
template<typename F_ = F, std::enable_if_t< frames::has_lon_lat_v< F_ >, int > = 0>
qtty::Degree siderust::spherical::Direction< F >::latitude ( ) const
inline

Definition at line 99 of file spherical.hpp.

◆ lon()

template<typename F >
template<typename F_ = F, std::enable_if_t< frames::has_lon_lat_v< F_ >, int > = 0>
qtty::Degree siderust::spherical::Direction< F >::lon ( ) const
inline

Definition at line 90 of file spherical.hpp.

◆ longitude()

template<typename F >
template<typename F_ = F, std::enable_if_t< frames::has_lon_lat_v< F_ >, int > = 0>
qtty::Degree siderust::spherical::Direction< F >::longitude ( ) const
inline

Definition at line 96 of file spherical.hpp.

◆ ra()

template<typename F >
template<typename F_ = F, std::enable_if_t< frames::has_ra_dec_v< F_ >, int > = 0>
qtty::Degree siderust::spherical::Direction< F >::ra ( ) const
inline
Examples
coordinate_systems_example.cpp, and demo.cpp.

Definition at line 66 of file spherical.hpp.

Referenced by main(), and spherical_direction_example().

◆ to()

template<typename F >
template<typename Target >
auto siderust::spherical::Direction< F >::to ( const JulianDate jd) const -> decltype(this->template to_frame<Target>(jd))
inline

Shorthand: .to<Target>(jd) (calls to_frame).

Examples
coordinate_systems_example.cpp, and demo.cpp.

Definition at line 145 of file spherical.hpp.

Referenced by main(), and spherical_direction_example().

◆ to_c()

template<typename F >
siderust_spherical_dir_t siderust::spherical::Direction< F >::to_c ( ) const
inline

◆ to_frame()

template<typename F >
template<typename Target >
std::enable_if_t< frames::has_frame_transform_v< F, Target >, Direction< Target > > siderust::spherical::Direction< F >::to_frame ( const JulianDate jd) const
inline

Transform to a different reference frame.

Only enabled for frame pairs with a FrameRotationProvider in the FFI. Attempting an unsupported transform is a compile-time error.

Template Parameters
TargetDestination frame tag.
Examples
demo.cpp.

Definition at line 125 of file spherical.hpp.

References siderust::check_status(), and siderust::spherical::Direction< F >::from_c().

Referenced by main().

◆ to_horizontal()

template<typename F >
template<typename F_ = F>
std::enable_if_t< frames::has_horizontal_transform_v< F_ >, Direction< frames::Horizontal > > siderust::spherical::Direction< F >::to_horizontal ( const JulianDate jd,
const Geodetic observer 
) const
inline

Transform to the horizontal (alt-az) frame.

Examples
coordinate_systems_example.cpp, and demo.cpp.

Definition at line 157 of file spherical.hpp.

References siderust::check_status(), siderust::spherical::Direction< F >::from_c(), and siderust::Geodetic::to_c().

Referenced by main(), and spherical_direction_example().


The documentation for this struct was generated from the following file: