![]() |
siderust-cpp 0.8.0
Header-only C++ wrapper for siderust
|
A unit-vector direction in Cartesian form, compile-time frame-tagged. More...
#include <siderust/coordinates/cartesian.hpp>
Public Member Functions | |
| Direction () | |
| Direction (double x_, double y_, double z_) | |
| double | dot (const Direction &other) const |
| Dot product of two unit-direction vectors. | |
| double | angle_to (const Direction &other) const |
| Angle between this direction and another, in radians. | |
| 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 this direction 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 this direction with an explicit astronomical 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). | |
Static Public Member Functions | |
| static constexpr siderust_frame_t | frame_id () |
Public Attributes | |
| double | x |
| X component (unitless). | |
| double | y |
| Y component (unitless). | |
| double | z |
| Z component (unitless). | |
A unit-vector direction in Cartesian form, compile-time frame-tagged.
Mirrors Rust's affn::cartesian::Direction<F>.
| F | Reference frame tag (e.g. frames::ICRS). |
Definition at line 41 of file cartesian.hpp.
|
inline |
Definition at line 48 of file cartesian.hpp.
|
inline |
Definition at line 49 of file cartesian.hpp.
Angle between this direction and another, in radians.
Uses the dot product (numerically clamped to avoid acos domain errors). Returns a value in [0, π].
| other | Direction in the same frame. |
Definition at line 70 of file cartesian.hpp.
References siderust::cartesian::Direction< F >::dot(), and siderust::cartesian::Direction< F >::to_frame().
Dot product of two unit-direction vectors.
Returns cos(θ) where θ is the angle between the two directions. Result is in [-1, 1].
Definition at line 59 of file cartesian.hpp.
References siderust::cartesian::Direction< F >::to_frame(), siderust::cartesian::Direction< F >::x, siderust::cartesian::Direction< F >::y, and siderust::cartesian::Direction< F >::z.
Referenced by siderust::cartesian::Direction< F >::angle_to().
|
inlinestaticconstexpr |
Definition at line 51 of file cartesian.hpp.
|
inline |
Shorthand: .to<Target>(jd) (calls to_frame).
Definition at line 127 of file cartesian.hpp.
References siderust::cartesian::Direction< F >::to_frame().
|
inline |
Transform this direction to a different reference frame.
Only enabled when a FrameRotationProvider exists for the pair (F, Target). For time-independent (fixed-epoch) transforms, jd is still required but its value is ignored.
| Target | Destination frame tag. |
| jd | Julian Date (TT) for time-dependent rotations. |
Definition at line 91 of file cartesian.hpp.
References siderust::check_status(), siderust::cartesian::Direction< F >::to_frame(), siderust::cartesian::Direction< F >::x, siderust::cartesian::Direction< F >::y, and siderust::cartesian::Direction< F >::z.
Referenced by siderust::cartesian::Direction< F >::angle_to(), siderust::cartesian::Direction< F >::dot(), siderust::cartesian::Direction< F >::to(), siderust::cartesian::Direction< F >::to_frame(), and siderust::cartesian::Direction< F >::to_frame_with().
|
inline |
Transform this direction with an explicit astronomical context.
Definition at line 109 of file cartesian.hpp.
References siderust::check_status(), siderust::cartesian::Direction< F >::to_frame(), siderust::cartesian::Direction< F >::x, siderust::cartesian::Direction< F >::y, and siderust::cartesian::Direction< F >::z.
X component (unitless).
Definition at line 44 of file cartesian.hpp.
Referenced by siderust::cartesian::Direction< F >::dot(), siderust::cartesian::operator<<(), siderust::cartesian::Direction< F >::to_frame(), and siderust::cartesian::Direction< F >::to_frame_with().
Y component (unitless).
Definition at line 45 of file cartesian.hpp.
Referenced by siderust::cartesian::Direction< F >::dot(), siderust::cartesian::operator<<(), siderust::cartesian::Direction< F >::to_frame(), and siderust::cartesian::Direction< F >::to_frame_with().
Z component (unitless).
Definition at line 46 of file cartesian.hpp.
Referenced by siderust::cartesian::Direction< F >::dot(), siderust::cartesian::operator<<(), siderust::cartesian::Direction< F >::to_frame(), and siderust::cartesian::Direction< F >::to_frame_with().