siderust-cpp 0.8.0
Header-only C++ wrapper for siderust
Loading...
Searching...
No Matches
orbital_center.hpp
Go to the documentation of this file.
1#pragma once
2
35#include "centers.hpp"
36#include "ffi_core.hpp"
37#include "orbit.hpp"
38#include <cstdint>
39#include <ostream>
40
41namespace siderust {
42
50enum class OrbitReferenceCenter : std::uint8_t {
52 Barycentric = 0,
54 Heliocentric = 1,
56 Geocentric = 2,
57};
58
98
101
109 : orbit(orb), orbit_center(center) {}
110
122
134
144
147 : orbit{qtty::AstronomicalUnit(1.0), Eccentricity{0.0}, qtty::Degree(0.0),
148 qtty::Degree(0.0), qtty::Degree(0.0), qtty::Degree(0.0),
149 Time<TT, JD>::J2000()},
151
154 SiderustBodycentricParams to_c() const {
155 SiderustBodycentricParams c{};
156 c.orbit = orbit.to_c();
157 c.orbit_center = static_cast<uint8_t>(orbit_center);
158 return c;
159 }
160};
161
162// Stream operator for OrbitReferenceCenter
163inline std::ostream &operator<<(std::ostream &os, OrbitReferenceCenter center) {
164 switch (center) {
166 return os << "Barycentric";
168 return os << "Heliocentric";
170 return os << "Geocentric";
171 }
172 return os << "Unknown";
173}
174
175} // namespace siderust
Zero-sized reference-center tag types mirroring Rust's centers module.
Error handling and utility base for the siderust C++ wrapper.
tempoch::EncodedTime< Scale, Format > Time
Definition time.hpp:36
std::ostream & operator<<(std::ostream &os, AzimuthExtremumKind kind)
Stream operator for AzimuthExtremumKind.
Definition azimuth.hpp:395
OrbitReferenceCenter
Specifies the reference center for an orbit.
@ Heliocentric
Orbit defined relative to the Sun (planets, asteroids, comets).
@ Barycentric
Orbit defined relative to the solar system barycenter.
@ Geocentric
Orbit defined relative to Earth (artificial satellites, Moon).
tempoch::scale::TT TT
Definition time.hpp:18
tempoch::format::JD JD
Definition time.hpp:27
Orbit model wrappers and propagation helpers.
Parameters for a body-centric coordinate system.
OrbitReferenceCenter orbit_center
Which standard center the orbit is defined relative to.
SiderustBodycentricParams to_c() const
static BodycentricParams heliocentric(const KeplerianOrbit &orb)
Creates parameters for a body orbiting the Sun.
BodycentricParams()
Default: circular 1 AU heliocentric orbit (placeholder).
KeplerianOrbit orbit
Keplerian orbital elements of the body.
static BodycentricParams barycentric(const KeplerianOrbit &orb)
Creates parameters for a body orbiting the barycenter.
BodycentricParams(const KeplerianOrbit &orb, OrbitReferenceCenter center)
Creates parameters for a body with the given orbit.
static BodycentricParams geocentric(const KeplerianOrbit &orb)
Creates parameters for a body orbiting Earth.
siderust_orbit_t to_c() const
Definition orbit.hpp:71