Crate rhorizons

Source
Expand description

crates.io

Access NASA JPL Horizons system from Rust. This crate is written in asynchronous code, therefore you probably want to use it in conjunction with tokio.

§Example

#[tokio::main]
async fn main() {
    println!("Major bodies in the Solar System.");

    for body in rhorizons::major_bodies().await {
        println!("{} ({})", body.name, body.id);
    }
}

You can check more examples in the source repository.

Structs§

EphemerisOrbitalElementsItem
Orbital Elements of a body. Units are km, s and degrees
EphemerisVectorItem
Position (in km) and velocity (in km/s) of a body.
MajorBody
Planet, natural satellite, spacecraft, Sun, barycenter, or other objects having pre-computed trajectories.

Functions§

ephemeris_orbital_elements
Get orbital element ephemeris (e.g. eccentricity, semi-major axis, …) of a major body relative to the Sun’s center
ephemeris_vector
Get vector ephemeris (position and velocity) of a major body. Coordinates are relative to the Sun’s center.
major_bodies
Get names and identifiers of all major bodies in the Solar System.