[][src]Module nyx_space::celestia

Provides the solar system planets, and state and (later) ephemeride management.

State creation and management

extern crate hifitime;
extern crate nyx_space as nyx;

use hifitime::Epoch;
use nyx::celestia::{Cosm, State};
let mut cosm = Cosm::from_xb("./de438s");
// We're actually going to use the GMAT value for Earth GM (de438s has a slightly different value).
cosm.mut_gm_for_frame("EME2000", 398_600.441_5);
// In this case, we're creating these states around a Geoid which is Earth.
let eme2k = cosm.frame("EME2000");
let dt = Epoch::from_mjd_tai(21545.0);
let cart = State::cartesian(
        5_946.673_548_288_958,
        1_656.154_606_023_661,
        2_259.012_129_598_249,
        -3.098_683_050_943_824,
        4.579_534_132_135_011,
        6.246_541_551_539_432,
        dt,
        eme2k,
);

let kep = State::keplerian(
       7_712.186_117_895_041,
       0.158_999_999_999_999_95,
       53.75369,
       1.998_632_864_211_17e-5,
       359.787_880_000_004,
       25.434_003_407_751_188,
       dt,
       eme2k
);
// We can check whether two states are equal.
if cart != kep {
    dbg!("{:?}", cart-kep);
    panic!("This won't happen");
}
// Of more interest, we can fetch specific orbital elements.
println!("sma = {} km   inc = {} degrees", cart.sma(), cart.inc());
// Note that the state data is stored as X, Y, Z, VX, VY, VZ.
// Hence, the following print statement may display some rounded values despite
// being created with fixed values. GMAT has the same "issue"
// (but `nyx` won't change your script).
println!("ecc = {} km   RAAN = {} degrees", kep.ecc(), cart.raan());

Modules

bodies

Known planets IDs defined for ease of access. All Cosm objects may be accessed via Cosm directly.

eclipse

The eclipse module allows finding eclipses and (conversely) visibility between a state and another one (e.g. a planet or the Sun).

orientations

Known orientation IDs defined for ease of access. All Cosm objects may be accessed via Cosm directly.

Structs

Cosm
Euler3Axis

A fixed three-axis Euler rotation

Euler3AxisDt

A time varying three-axis Euler rotation

IoError

The error type for I/O operations of the Read, Write, Seek, and associated traits.

NoRotation
State

State defines an orbital state parameterized by a CelestialBody.

XbId

Enums

AngleUnit
CosmError
EulerRotation

Defines an Euler rotation, angle must be in radians

Frame
LTCorr

Enable or not light time correction for the computation of the celestial states

Constants

AU

Astronomical unit, in kilometers, according to the IAU.

ECC_EPSILON

If an orbit has an eccentricity below the following value, it is considered circular (only affects warning messages)

SPEED_OF_LIGHT

Speed of light in meters per second

SPEED_OF_LIGHT_KMS

Speed of light in kilometers per second

SS_MASS

Mass of the solar system from https://en.wikipedia.org/w/index.php?title=Special:CiteThisPage&page=Solar_System&id=905437334

SUN_GM

Mass of the Sun

Traits

CelestialBody

CelestialBody represents a celestial body.

ParentRotation

Functions

load_ephemeris

Loads the provided input_filename as an EXB