nsat / sgp4-rs

A Rust package for the SGP-4 orbital propagator.
MIT License
8 stars 3 forks source link

Allow extracting and modifying the orbital elements of a TLE #9

Closed nick-pascucci-spire closed 3 years ago

nick-pascucci-spire commented 3 years ago

The naming used in the original SGP4 sources can be quite baroque. This is common for mathematically intensive code, where names often follow the symbols used within a standard mathematical formulation, but without the corresponding formulae to reference it can be quite difficult to know what a parameter actually is. Fortunately we are not bound to the naming that SGP4 uses, as we only need to be binary-compatible with the C++ implementation. This commit renames some of the fields -- namely, those that relate to the TLE orbital elements and a few others -- to make their meaning more obvious.

In the public API, the TwoLineElement structure now supports extracting and setting these values in a type safe way. The structure uses the uom crate to provide dimensional analysis, which can help avoid unit-of-measure errors.