![]() |
siderust-cpp 0.8.0
Header-only C++ wrapper for siderust
|
A spherical position (direction + distance), compile-time tagged. More...
#include <siderust/coordinates/spherical.hpp>
Public Member Functions | |
| Position (qtty::Degree azimuth, qtty::Degree polar, U distance) | |
| Position (const Direction< F > &dir, U distance) | |
| Direction< F > | direction () const |
| Extract the direction component. | |
| U | distance () const |
| cartesian::Position< C, F, U > | to_cartesian () const |
| Convert this spherical position to a cartesian Position<C,F,U>. | |
| template<typename Target > | |
| std::enable_if_t< frames::has_frame_transform_v< F, Target >, Position< C, Target, U > > | to_frame (const Time< TT, JD > &jd) const |
| Transform this position to a different reference frame (same center). | |
| template<typename Target > | |
| std::enable_if_t< frames::has_frame_transform_v< F, Target >, Position< C, Target, U > > | to_frame_with (const Time< TT, JD > &jd, const AstroContext &ctx) const |
| 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). | |
| qtty::Degree | angular_separation (const Position &other) const |
| Angular separation between this position's direction and another's. | |
| U | distance_to (const Position &other) const |
Component accessors by frame convention | |
| 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 |
| 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_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 |
Static Public Member Functions | |
| static constexpr siderust_frame_t | frame_id () |
| static constexpr siderust_center_t | center_id () |
A spherical position (direction + distance), compile-time tagged.
Mirrors Rust's affn::spherical::Position<C, F, U>.
| C | Reference center tag (e.g. centers::Barycentric). |
| F | Reference frame tag (e.g. frames::ICRS). |
| U | Distance unit (default: qtty::Meter). |
Definition at line 287 of file spherical.hpp.
|
inline |
Definition at line 297 of file spherical.hpp.
|
inline |
Definition at line 300 of file spherical.hpp.
|
inline |
Definition at line 324 of file spherical.hpp.
|
inline |
Definition at line 329 of file spherical.hpp.
|
inline |
Angular separation between this position's direction and another's.
Uses the Vincenty formula for numerical stability. The distance component is ignored — only the angles matter.
| other | Position in the same center and frame. |
Definition at line 389 of file spherical.hpp.
References siderust::spherical::Position< C, F, U >::direction(), and siderust::spherical::Position< C, F, U >::to_frame().
|
inline |
Definition at line 319 of file spherical.hpp.
|
inlinestaticconstexpr |
Definition at line 345 of file spherical.hpp.
|
inline |
Definition at line 314 of file spherical.hpp.
Referenced by siderust::spherical::operator<<().
Extract the direction component.
Definition at line 304 of file spherical.hpp.
References siderust::spherical::Position< C, F, U >::to_frame().
Referenced by siderust::spherical::Position< C, F, U >::angular_separation().
|
inline |
Definition at line 347 of file spherical.hpp.
Referenced by siderust::spherical::operator<<().
|
inline |
Definition at line 393 of file spherical.hpp.
References siderust::constants::pi, and siderust::spherical::Position< C, F, U >::to_frame().
|
inlinestaticconstexpr |
Definition at line 344 of file spherical.hpp.
|
inline |
Definition at line 339 of file spherical.hpp.
|
inline |
Definition at line 334 of file spherical.hpp.
|
inline |
Definition at line 309 of file spherical.hpp.
Referenced by siderust::spherical::operator<<().
|
inline |
Shorthand: .to<Target>(jd) (calls to_frame).
Definition at line 376 of file spherical.hpp.
References siderust::spherical::Position< C, F, U >::to_frame().
| cartesian::Position< C, F, U > siderust::spherical::Position< C, F, U >::to_cartesian | ( | ) | const |
Convert this spherical position to a cartesian Position<C,F,U>.
Definition at line 31 of file pos_conversions.hpp.
References siderust::constants::pi.
| std::enable_if_t< frames::has_frame_transform_v< F, Target >, Position< C, Target, U > > siderust::spherical::Position< C, F, U >::to_frame | ( | const Time< TT, JD > & | jd | ) | const |
Transform this position to a different reference frame (same center).
Internally converts to Cartesian, applies the frame rotation, then converts back to spherical. Only enabled when a FrameRotationProvider exists for the pair (F, Target).
| Target | Destination frame tag. |
| jd | Julian Date (TT) for time-dependent rotations. |
Referenced by siderust::spherical::Position< C, F, U >::angular_separation(), siderust::spherical::Position< C, F, U >::direction(), siderust::spherical::Position< C, F, U >::distance_to(), and siderust::spherical::Position< C, F, U >::to().
| std::enable_if_t< frames::has_frame_transform_v< F, Target >, Position< C, Target, U > > siderust::spherical::Position< C, F, U >::to_frame_with | ( | const Time< TT, JD > & | jd, |
| const AstroContext & | ctx | ||
| ) | const |