From 71b006bcb3588051092fa6657a4223c475365c19 Mon Sep 17 00:00:00 2001 From: ApsisRS contributors Date: Sat, 26 Sep 2026 23:43:51 +0800 Subject: [PATCH] apsis-rs: reuse the shared Earth radius in the network examples Both network examples repeated the WGS 84 equatorial radius that apsis-core already exports, so a change to the ellipsoid would not reach them. Use the constant. --- crates/apsis-rs/examples/dump_coverage.rs | 5 +++-- crates/apsis-rs/examples/integrate_network.rs | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/apsis-rs/examples/dump_coverage.rs b/crates/apsis-rs/examples/dump_coverage.rs index c3e7517..73eca5f 100644 --- a/crates/apsis-rs/examples/dump_coverage.rs +++ b/crates/apsis-rs/examples/dump_coverage.rs @@ -25,8 +25,9 @@ use core::f64::consts::PI; /// The WGS 84 equatorial radius, in kilometers. /// /// The coverage geometry is spherical, so a single radius is used. The -/// equatorial value is the one the orbit layer works in. -const BODY_RADIUS_KM: f64 = 6_378.137; +/// value comes from the shared constants rather than being repeated, so a +/// change to the ellipsoid reaches here. +const BODY_RADIUS_KM: f64 = apsis_core::constant::EARTH_EQUATORIAL_RADIUS; /// One coverage case: an orbital radius and an elevation mask. struct Case { diff --git a/crates/apsis-rs/examples/integrate_network.rs b/crates/apsis-rs/examples/integrate_network.rs index 5c6d92e..2ab4a92 100644 --- a/crates/apsis-rs/examples/integrate_network.rs +++ b/crates/apsis-rs/examples/integrate_network.rs @@ -41,7 +41,9 @@ use apsis_tle::TwoLineElement; use apsis_topology::{Topology, TopologySample, TopologySeries}; /// The Earth equatorial radius, in kilometers, used for the link geometry. -const BODY_RADIUS_KM: f64 = 6_378.137; +/// +/// The value comes from the shared constants rather than being repeated. +const BODY_RADIUS_KM: f64 = apsis_core::constant::EARTH_EQUATORIAL_RADIUS; /// The element set of a satellite in a 550 km orbit, used as the source of /// the propagated track.