![]() |
siderust-cpp 0.8.0
Header-only C++ wrapper for siderust
|
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) | |
| qtty::Degree | angular_separation (const Direction &other) const |
| Angular separation between this direction and another. | |
| template<typename Target > | |
| std::enable_if_t< frames::has_frame_transform_v< F, Target >, Direction< Target > > | to_frame (const Time< TT, JD > &jd) const |
| Transform to a different reference frame. | |
| template<typename Target > | |
| std::enable_if_t< frames::has_frame_transform_v< F, Target >, Direction< Target > > | to_frame_with (const Time< TT, JD > &jd, const AstroContext &ctx) const |
| Transform to a different reference frame with an explicit context. | |
| template<typename Target > | |
| auto | to (const Time< TT, JD > &jd) const -> decltype(this->template to_frame< Target >(jd)) |
Shorthand: .to<Target>(jd) (calls to_frame). | |
| cartesian::Direction< F > | to_cartesian () const |
| Convert this spherical direction to a Cartesian unit vector. | |
| template<typename F_ = F> | |
| std::enable_if_t< frames::has_horizontal_transform_v< F_ >, Direction< frames::Horizontal > > | to_horizontal (const Time< TT, JD > &jd, const Geodetic &observer) const |
| Transform to the horizontal (alt-az) frame. | |
| template<typename F_ = F> | |
| std::enable_if_t< frames::has_horizontal_transform_v< F_ >, Direction< frames::Horizontal > > | to_horizontal_with (const Time< TT, JD > &jd, const Geodetic &observer, const AstroContext &ctx) const |
| Transform to the horizontal frame with an explicit context. | |
| template<typename F_ = F> | |
| std::enable_if_t< frames::has_horizontal_transform_v< F_ >, Direction< frames::Horizontal > > | to_horizontal_precise (const Time< TT, JD > &jd_tt, const Time< UT1, JD > &jd_ut1, const Geodetic &observer) const |
| High-precision horizontal transform with explicit TT and UT1 epochs. | |
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) |
A direction on the celestial sphere, compile-time tagged by frame.
Mirrors Rust's affn::spherical::Direction<F>.
| F | Reference frame chapter content removed. Restore the original from \texttt{archived_worktree/tex/chapters/12-logging-audit.tex} if needed. tag (e.g. frames::ICRS). |
Definition at line 50 of file spherical.hpp.
|
inline |
Definition at line 58 of file spherical.hpp.
Referenced by siderust::spherical::Direction< F >::from_c().
|
inline |
Definition at line 60 of file spherical.hpp.
|
inline |
Definition at line 89 of file spherical.hpp.
|
inline |
Definition at line 94 of file spherical.hpp.
|
inline |
Definition at line 99 of file spherical.hpp.
|
inline |
Angular separation between this direction and another.
Uses the Vincenty formula for numerical stability, even near 0° and 180°.
| other | Direction in the same frame. |
Definition at line 144 of file spherical.hpp.
References siderust::constants::pi, and siderust::spherical::Direction< F >::to_frame().
|
inline |
Definition at line 84 of file spherical.hpp.
Referenced by siderust::spherical::Direction< F >::to_cartesian().
|
inline |
Definition at line 76 of file spherical.hpp.
Referenced by siderust::Star::create(), siderust::DirectionTarget< C >::DirectionTarget(), siderust::DirectionTarget< C >::name(), siderust::spherical::operator<<(), and siderust::ProperMotionTarget::ProperMotionTarget().
|
inlinestaticconstexpr |
Definition at line 64 of file spherical.hpp.
Referenced by siderust::spherical::Direction< F >::to_c().
|
inlinestaticconstexpr |
Definition at line 65 of file spherical.hpp.
|
inlinestatic |
Definition at line 131 of file spherical.hpp.
References siderust::spherical::Direction< F >::Direction(), and siderust::spherical::Direction< F >::to_frame().
Referenced by siderust::spherical::Direction< F >::to_frame(), siderust::spherical::Direction< F >::to_frame_with(), siderust::spherical::Direction< F >::to_horizontal(), siderust::spherical::Direction< F >::to_horizontal_precise(), and siderust::spherical::Direction< F >::to_horizontal_with().
|
inline |
Definition at line 112 of file spherical.hpp.
|
inline |
Definition at line 122 of file spherical.hpp.
|
inline |
Definition at line 107 of file spherical.hpp.
|
inline |
Definition at line 117 of file spherical.hpp.
|
inline |
Definition at line 71 of file spherical.hpp.
Referenced by siderust::Star::create(), siderust::DirectionTarget< C >::DirectionTarget(), siderust::DirectionTarget< C >::name(), siderust::spherical::operator<<(), and siderust::ProperMotionTarget::ProperMotionTarget().
|
inline |
Shorthand: .to<Target>(jd) (calls to_frame).
Definition at line 205 of file spherical.hpp.
References siderust::spherical::Direction< F >::to_frame().
|
inline |
Definition at line 129 of file spherical.hpp.
References siderust::spherical::Direction< F >::frame_id().
Referenced by siderust::icrs_altitude::altitude_at(), siderust::icrs_altitude::azimuth_at(), and siderust::Subject::icrs().
|
inline |
Convert this spherical direction to a Cartesian unit vector.
Mirrors Rust's affn::spherical::Direction::to_cartesian(). The result is a frame-tagged unit vector in cartesian::Direction<F>.
Definition at line 215 of file spherical.hpp.
References siderust::spherical::Direction< F >::az(), siderust::constants::pi, and siderust::spherical::Direction< F >::to_frame().
|
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.
| Target | Destination frame tag. |
Definition at line 169 of file spherical.hpp.
References siderust::check_status(), siderust::spherical::Direction< F >::from_c(), and siderust::spherical::Direction< F >::to_frame().
Referenced by siderust::spherical::Direction< F >::angular_separation(), siderust::spherical::Direction< F >::from_c(), siderust::spherical::Direction< F >::to(), siderust::spherical::Direction< F >::to_cartesian(), siderust::spherical::Direction< F >::to_frame(), siderust::spherical::Direction< F >::to_frame_with(), siderust::spherical::Direction< F >::to_horizontal(), siderust::spherical::Direction< F >::to_horizontal_precise(), and siderust::spherical::Direction< F >::to_horizontal_with().
|
inline |
Transform to a different reference frame with an explicit context.
Definition at line 187 of file spherical.hpp.
References siderust::check_status(), siderust::spherical::Direction< F >::from_c(), and siderust::spherical::Direction< F >::to_frame().
|
inline |
Transform to the horizontal (alt-az) frame.
Definition at line 228 of file spherical.hpp.
References siderust::check_status(), siderust::spherical::Direction< F >::from_c(), and siderust::spherical::Direction< F >::to_frame().
|
inline |
High-precision horizontal transform with explicit TT and UT1 epochs.
Use this overload when you have separately-computed TT and UT1 Julian Dates available (e.g. from a precise time-scale conversion) and want maximum accuracy without constructing an explicit AstroContext.
| jd_tt | Terrestrial Time (TT) Julian Date. |
| jd_ut1 | Universal Time (UT1) Julian Date. |
| observer | Observer geodetic position. |
Definition at line 266 of file spherical.hpp.
References siderust::check_status(), siderust::spherical::Direction< F >::from_c(), and siderust::spherical::Direction< F >::to_frame().
|
inline |
Transform to the horizontal frame with an explicit context.
Definition at line 242 of file spherical.hpp.
References siderust::check_status(), siderust::spherical::Direction< F >::from_c(), and siderust::spherical::Direction< F >::to_frame().