sgp 1.0.3

Simplified General Perturbations models (SGP8/SGP4) in Rust.
Documentation
  • Coverage
  • 55.56%
    15 out of 27 items documented1 out of 1 items with examples
  • Size
  • Source code size: 6.63 MB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.89 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 20s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • qchen-fdii-cardc
sgp-1.0.3 has been yanked.

SGP in Rust

A simple implementation of the Simplified General Perturbations models (SGP8/SGP4) in Rust.

The results are validated against the original MATLAB implementations:

License

This project is licensed under the GNU General Public License v3.0 only (GPL-3.0-only). See the LICENSE file for details.

Usage

Simple usage example.

  1. cargo add sgp to add the dependency.
  2. Use the following code to propagate a satellite using SGP4:
use sgp::sgp4;
use sgp::parse_tle_lines;

fn main() {
    let tle_line1 = "1 25544U 98067A   20344.91667824  .00016717  00000-0  10270-3 0  9003";
    let tle_line2 = "2 25544  51.6442 348.7413 0002393  85.0646 325.0584 15.49325993257145";

    let sat = parse_tle_lines(tle_line1, tle_line2).expect("Error parsing TLE lines");

    // Propagate to 60 minutes after epoch
    let (position, velocity) = sgp4(60.0_f64, &sat);

    println!("Position (km): {:?}", position);
    println!("Velocity (km/s): {:?}", velocity);
}

For SGP8 usage, use sgp::sgp8 just like sgp::sgp4.