space_dust/lib.rs
1//! # SpaceDust
2//!
3//! A comprehensive astrodynamics library for Rust, providing tools for satellite tracking,
4//! orbital mechanics, coordinate transformations, and ground-based observation calculations.
5//!
6//! ## Features
7//!
8//! - **Time Systems**: Conversions between UTC, TAI, TT, Julian Date, GPS, and GMST
9//! - **Coordinate Frames**: Transformations between ECI J2000, TEME, ECEF, and Geodetic
10//! - **Orbital Elements**: Conversions between Cartesian state vectors and Keplerian elements
11//! - **TLE Parsing**: Parse and propagate Two-Line Element Sets using SGP4
12//! - **Celestial Bodies**: Sun and Moon position calculations
13//! - **Ground Observations**: Azimuth/Elevation and Right Ascension/Declination calculations
14//!
15//! ## Quick Start
16//!
17//! ```rust,no_run
18//! use space_dust::tle::Tle;
19//! use space_dust::state::{TEMEState, GeodeticState, StateTransforms};
20//! use space_dust::observations::Observations;
21//! use chrono::Utc;
22//!
23//! // Parse a TLE
24//! let line1 = "1 25544U 98067A 24001.50000000 .00016717 00000-0 10270-3 0 9002";
25//! let line2 = "2 25544 51.6400 208.1200 0001234 85.0000 275.0000 15.48919100123456";
26//! let tle = Tle::parse(line1, line2).unwrap();
27//!
28//! // Propagate to current time
29//! let epoch = Utc::now();
30//! let teme_state = tle.propagate(&epoch).unwrap();
31//!
32//! // Convert to ECI J2000
33//! let eci_state = teme_state.to_eci();
34//!
35//! // Define a ground observer (Denver, CO)
36//! let observer = GeodeticState::new(39.7392, -104.9903, 1.6);
37//!
38//! // Compute observation angles
39//! let az_el = Observations::compute_az_el(&observer, &eci_state);
40//! println!("Azimuth: {:.2}°, Elevation: {:.2}°", az_el.azimuth_deg(), az_el.elevation_deg());
41//! ```
42
43pub mod bodies;
44pub mod constants;
45pub mod data;
46pub mod math;
47pub mod observations;
48pub mod state;
49pub mod time;
50pub mod tle;
51
52// Re-export commonly used types
53pub use bodies::{Earth, Moon, Sun};
54pub use constants::Constants;
55pub use math::{Matrix3, Vector3};
56pub use observations::{AzEl, Observations, RaDec};
57pub use state::{
58 ECEFState, ECIState, GeodeticState, KeplerianElements, StateTransforms, TEMEState,
59};
60pub use time::{JulianDate, TimeTransforms, GMST, GPS, TAI, TT, UTC};
61pub use tle::Tle;
62
63/// Library version
64pub const VERSION: &str = "0.1.0";
65
66/// Returns the library version
67pub fn version() -> &'static str {
68 VERSION
69}
70
71#[cfg(test)]
72mod tests {
73 use super::*;
74
75 #[test]
76 fn test_version() {
77 assert_eq!(version(), "0.1.0");
78 }
79}