siderust-cpp 0.8.0
Header-only C++ wrapper for siderust
Loading...
Searching...
No Matches
siderust::BodycentricParams Struct Reference

Parameters for a body-centric coordinate system. More...

#include <siderust/orbital_center.hpp>

Collaboration diagram for siderust::BodycentricParams:

Public Member Functions

 BodycentricParams (const KeplerianOrbit &orb, OrbitReferenceCenter center)
 Creates parameters for a body with the given orbit.
 
 BodycentricParams ()
 Default: circular 1 AU heliocentric orbit (placeholder).
 
SiderustBodycentricParams to_c () const
 

Static Public Member Functions

static BodycentricParams heliocentric (const KeplerianOrbit &orb)
 Creates parameters for a body orbiting the Sun.
 
static BodycentricParams geocentric (const KeplerianOrbit &orb)
 Creates parameters for a body orbiting Earth.
 
static BodycentricParams barycentric (const KeplerianOrbit &orb)
 Creates parameters for a body orbiting the barycenter.
 

Public Attributes

KeplerianOrbit orbit
 Keplerian orbital elements of the body.
 
OrbitReferenceCenter orbit_center
 Which standard center the orbit is defined relative to.
 

Detailed Description

Parameters for a body-centric coordinate system.

Specifies the orbital elements of a celestial body and the reference center for those elements. This allows computing a body's position at any Julian date using Keplerian propagation, then using that position as the origin of a coordinate system.

Use Cases

  • Satellites: Define L1, L2, L3, L4, L5 positions relative to their parent body (e.g., a halo orbit at the Sun-Earth L2).
  • Planets: Compute stellar positions as seen from another planet.
  • Moons: Express coordinates relative to a moon's center (e.g., Phobos relative to Mars).

Example: L2 Satellite

// Approximate L2 orbit (1.5M km from Earth on opposite side of Sun)
// In practice, L2 is a quasi-periodic Halo orbit, but we approximate here
KeplerianOrbit l2_approx = {
1.0, // semi_major_axis_au (~1 AU from Sun, like Earth)
0.01, // eccentricity (small: stable near L2)
0.0, // inclination_deg
0.0, // lon_ascending_node_deg
0.0, // arg_periapsis_deg
0.0, // mean_anomaly_deg
};
// Now use l2_center as the reference for body-centric coordinates
// to express Mars's position relative to L2.
tempoch::EncodedTime< Scale, Format > Time
Definition time.hpp:36
Parameters for a body-centric coordinate system.
static BodycentricParams heliocentric(const KeplerianOrbit &orb)
Creates parameters for a body orbiting the Sun.
Examples
04_all_center_conversions.cpp.

Definition at line 95 of file orbital_center.hpp.

Constructor & Destructor Documentation

◆ BodycentricParams() [1/2]

siderust::BodycentricParams::BodycentricParams ( const KeplerianOrbit orb,
OrbitReferenceCenter  center 
)
inline

Creates parameters for a body with the given orbit.

Parameters
orbThe Keplerian orbital elements.
centerThe reference center for the orbit.

Definition at line 108 of file orbital_center.hpp.

◆ BodycentricParams() [2/2]

siderust::BodycentricParams::BodycentricParams ( )
inline

Default: circular 1 AU heliocentric orbit (placeholder).

Definition at line 146 of file orbital_center.hpp.

Referenced by barycentric(), geocentric(), and heliocentric().

Member Function Documentation

◆ barycentric()

static BodycentricParams siderust::BodycentricParams::barycentric ( const KeplerianOrbit orb)
inlinestatic

Creates parameters for a body orbiting the barycenter.

Parameters
orbBarycentric orbital elements.
Returns
BodycentricParams with Barycentric reference.

Definition at line 141 of file orbital_center.hpp.

References siderust::Barycentric, and BodycentricParams().

◆ geocentric()

static BodycentricParams siderust::BodycentricParams::geocentric ( const KeplerianOrbit orb)
inlinestatic

Creates parameters for a body orbiting Earth.

Use for artificial satellites, the Moon, etc.

Parameters
orbGeocentric orbital elements.
Returns
BodycentricParams with Geocentric reference.

Definition at line 131 of file orbital_center.hpp.

References BodycentricParams(), and siderust::Geocentric.

◆ heliocentric()

static BodycentricParams siderust::BodycentricParams::heliocentric ( const KeplerianOrbit orb)
inlinestatic

Creates parameters for a body orbiting the Sun.

Most common: planets, asteroids, comets.

Parameters
orbHeliocentric orbital elements.
Returns
BodycentricParams with Heliocentric reference.

Definition at line 119 of file orbital_center.hpp.

References BodycentricParams(), and siderust::Heliocentric.

◆ to_c()

SiderustBodycentricParams siderust::BodycentricParams::to_c ( ) const
inline

Convert to C FFI struct for passing to siderust_to_bodycentric / siderust_from_bodycentric.

Definition at line 154 of file orbital_center.hpp.

References orbit, orbit_center, and siderust::KeplerianOrbit::to_c().

Referenced by siderust::to_bodycentric(), and siderust::BodycentricPos< F, U >::to_geocentric().

Member Data Documentation

◆ orbit

KeplerianOrbit siderust::BodycentricParams::orbit

Keplerian orbital elements of the body.

Definition at line 97 of file orbital_center.hpp.

Referenced by to_c().

◆ orbit_center

OrbitReferenceCenter siderust::BodycentricParams::orbit_center

Which standard center the orbit is defined relative to.

Definition at line 100 of file orbital_center.hpp.

Referenced by to_c().


The documentation for this struct was generated from the following file: