summaryrefslogtreecommitdiffstats
path: root/src/solar_system/orbit.rs
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2026-05-07 08:50:05 -0400
committerJon Santmyer <jon@jonsantmyer.com>2026-05-07 08:50:05 -0400
commitc1adf64c1aaecd5a2b9d532d707ef35971f1aa18 (patch)
treefc1050becd0576d75a8d6afb8be09fae80c91541 /src/solar_system/orbit.rs
parent9788d9037ad7199701b1710c28559cb96bce5aec (diff)
downloadsystemic4x-c1adf64c1aaecd5a2b9d532d707ef35971f1aa18.tar.gz
systemic4x-c1adf64c1aaecd5a2b9d532d707ef35971f1aa18.tar.bz2
systemic4x-c1adf64c1aaecd5a2b9d532d707ef35971f1aa18.zip
begin work on body info window
Diffstat (limited to 'src/solar_system/orbit.rs')
-rw-r--r--src/solar_system/orbit.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/solar_system/orbit.rs b/src/solar_system/orbit.rs
index 461de7b..1800127 100644
--- a/src/solar_system/orbit.rs
+++ b/src/solar_system/orbit.rs
@@ -65,7 +65,7 @@ impl StaticOrbit
pub fn calculate_position_at(
&self,
- this_body: &OrbitalBody,
+ sgp: f64,
time: Second)
-> cgmath::Vector3<f64>
{
@@ -75,7 +75,7 @@ impl StaticOrbit
let arg_periaps = self.long_periapsis - long_asc_node;
let sma_cubed = self.semi_major_axis.powf(3.0);
- let mean_motion = (this_body.sgp() / sma_cubed).sqrt();
+ let mean_motion = (sgp / sma_cubed).sqrt();
let mean_anomaly_epoch = self.mean_long - self.long_periapsis;
let mean_anomaly = mean_anomaly_epoch + (mean_motion * time as f64);