Skip to content

Commit

Permalink
Refactor some more
Browse files Browse the repository at this point in the history
  • Loading branch information
helgee committed Jan 21, 2024
1 parent 8d8b435 commit 5da05a6
Show file tree
Hide file tree
Showing 10 changed files with 485 additions and 802 deletions.
10 changes: 7 additions & 3 deletions crates/lox-space/examples/iss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,21 @@ fn main() {
let epoch = Epoch::from_date_and_time(TimeScale::TDB, date, time);
let position = DVec3::new(6068279.27, -1692843.94, -2516619.18) * 1e-3;
let velocity = DVec3::new(-660.415582, 5495.938726, -5303.093233) * 1e-3;
let iss = Cartesian::new(epoch, Earth, Icrf, position, velocity);
let iss_cartesian = Cartesian::new(epoch, Earth, Icrf, position, velocity);
let iss = Keplerian::from(iss_cartesian);

println!("ISS Orbit for Julian Day {}", iss.time().days_since_j2000(),);
println!("=============================");
println!("Semi-major axis: {:.3} km", iss.semi_major());
println!("Semi-major axis: {:.3} km", iss.semi_major_axis());
println!("Eccentricity: {:.6}", iss.eccentricity());
println!("Inclination: {:.3}°", iss.inclination().to_degrees());
println!(
"Longitude of ascending node: {:.3}°",
iss.ascending_node().to_degrees()
);
println!("Argument of perigee: {}°", iss.periapsis_arg().to_degrees());
println!(
"Argument of perigee: {}°",
iss.periapsis_argument().to_degrees()
);
println!("True anomaly: {:.3}°", iss.true_anomaly().to_degrees());
}
2 changes: 1 addition & 1 deletion crates/lox-space/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

pub use lox_core::bodies::*;
pub use lox_core::coords::{Cartesian, DVec3, Keplerian, TwoBody};
pub use lox_core::coords::{Cartesian, DVec3, Keplerian};
pub use lox_core::frames::*;
pub use lox_core::time::dates::*;
pub use lox_core::time::epochs::*;
Loading

0 comments on commit 5da05a6

Please sign in to comment.