16template <
typename C,
typename F,
typename U>
18 const double x =
comp_x.value();
19 const double y =
comp_y.value();
20 const double z =
comp_z.value();
21 const double r = std::sqrt(
x *
x +
y *
y +
z *
z);
30template <
typename C,
typename F,
typename U>
35 lon_deg = azimuth_.value();
36 lat_deg = polar_.value();
38 lon_deg = azimuth_.value();
39 lat_deg = polar_.value();
41 lon_deg = azimuth_.value();
42 lat_deg = polar_.value();
47 const double r = dist_.value();
49 const double cx = r * std::cos(
lat) * std::cos(
lon);
50 const double cy = r * std::cos(
lat) * std::sin(
lon);
51 const double cz = r * std::sin(
lat);
58template <
typename C,
typename F,
typename U>
59template <
typename Target>
60std::enable_if_t<siderust::frames::has_frame_transform_v<F, Target>,
63 if constexpr (std::is_same_v<F, Target>) {
70template <
typename C,
typename F,
typename U>
71template <
typename Target>
72std::enable_if_t<siderust::frames::has_frame_transform_v<F, Target>,
75 if constexpr (std::is_same_v<F, Target>) {
Typed cartesian coordinate templates.
Portable mathematical constants (C++17, no platform macros).
constexpr double pi
Circle constant pi (radians per half-turn).
constexpr bool has_lon_lat_v
constexpr bool has_ra_dec_v
constexpr bool has_az_alt_v
tempoch::EncodedTime< Scale, Format > Time
Typed spherical coordinate templates.
A 3D Cartesian position, compile-time tagged by center, frame, unit.
std::enable_if_t< frames::has_frame_transform_v< frames::EclipticMeanJ2000, Target >, Position< centers::Heliocentric, Target, U > > to_frame_with(const Time< TT, JD > &jd, const AstroContext &ctx) const
spherical::Position< C, F, U > to_spherical() const
Convert this cartesian position to a spherical Position<C,F,U>.
std::enable_if_t< frames::has_frame_transform_v< frames::EclipticMeanJ2000, Target >, Position< centers::Heliocentric, Target, U > > to_frame(const Time< TT, JD > &jd) const
A spherical position (direction + distance), compile-time tagged.
cartesian::Position< C, F, U > to_cartesian() const
Convert this spherical position to a cartesian Position<C,F,U>.
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
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).