| Crates.io | sgp |
| lib.rs | sgp |
| version | 1.0.4 |
| created_at | 2025-11-13 07:36:13.775842+00 |
| updated_at | 2025-11-13 13:55:22.550516+00 |
| description | Simplified General Perturbations models (SGP8/SGP4) in Rust. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1930622 |
| size | 88,699 |
A simple implementation of the Simplified General Perturbations models (SGP8/SGP4) in Rust.
The results are validated against the original MATLAB implementations:
This project is licensed under the GNU General Public License v3.0 only (GPL-3.0-only). See the LICENSE file for details.
Simple usage example.
cargo add sgp to add the dependency.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.