Skip to content

Getting Started

Lox is an MPLv2-licensed open-source astrodynamics toolbox that can be used in Rust and Python. This guide will help you get started with a new project.

Lox is currently supported on the following operating systems:

  • macOS (ARM/Intel)
  • Linux (x64)
  • Windows (x86/x64)

Lox does not have any external dependencies except a working Rust or Python environment. We recommend installing Rust via rustup and Python via uv if they are not already installed. If you already have Rust or Python installed, make sure that the installed versions meet or exceed the versions below.

  • Rust 1.90+
  • Python 3.9+

Some functionality of Lox requires external data such as Earth orientation data or an ephemeris.

  • finals.all.csv
    • Earth orientation data for the IAU1980 theory of nutation.
  • finals2000A.all.csv
    • Earth orientation data for the IAU2000A theory of nutation.
  • de440s.bsp
    • Planetary ephemerides (or any other planetary SPK kernel).

Create a new project called learn-lox by running the following commands in your terminal.

Terminal window
cargo new --bin learn-lox

Change into the newly created learn-lox directory and install the Lox library by running the following commands.

Terminal window
cd learn-lox
cargo add lox-space

Open main.{py,rs} in your favourite code editor (or create it if it does not exist) and replace its contents with the following code.

src/main.rs
use lox_space::bodies::{Earth, PointMass};
fn main() {
let mu = Earth.gravitational_parameter();
println!("Hello, Earthling!");
println!(
"The gravitational parameter of your planet is {} km^3/s^2.",
mu
);
}

Run the program to make sure that everything works.

Terminal window
cargo run