pub struct LightContext {
pub two_grav_param_over_c3: f64,
}Expand description
Configuration for the Shapiro delay — the extra time light (or radio signals) takes to travel near a massive body because gravity curves spacetime.
In simple terms: when a light beam or radar pulse passes close to a star or planet, general relativity makes the path take a tiny bit longer than it would in flat space. This struct holds the single number that controls how strong that delay is for a particular central body (the Sun, a planet, another star, etc.).
Used in high-precision light-time calculations, spacecraft ranging, pulsar timing, and very-long-baseline interferometry (VLBI).
Fields§
§two_grav_param_over_c3: f642GM/c³ in seconds — the characteristic gravitational time scale used in the one-way Shapiro delay formula.
This is mathematically equal to 2 * GM / c³, where:
Gis Newton’s gravitational constant,- M is the mass of the central body,
cis the speed of light.
“GM” (often written as a single value called the standard gravitational parameter or μ) is the product of G and M. In real-world astronomy it is measured very accurately as one combined number (in m³/s²), so we keep it together here.
It tells the light-propagation code “how strong the gravitational slowing is” for this body. Bigger value = stronger delay effect.
Most users never set this manually — just use SOLAR or from_grav_param().
Implementations§
Source§impl LightContext
impl LightContext
Sourcepub const SOLAR: Self
pub const SOLAR: Self
Ready-to-use value for our own Sun, based on the exact IAU 2015 recommended constants.
Use this for any typical solar-system light-propagation calculation (radar to planets, spacecraft tracking, etc.).
Sourcepub const FLAT: Self
pub const FLAT: Self
No gravitational delay at all (flat spacetime approximation).
Perfect for:
- interstellar or intergalactic distances,
- quick “ignore gravity” calculations,
- or when you want to apply your own custom gravitational model elsewhere.
Sourcepub const fn from_grav_param(grav_param: f64) -> Self
pub const fn from_grav_param(grav_param: f64) -> Self
Creates a LightContext for any central body (planet, star, black hole, etc.).
§Arguments
grav_param— the body’s standard gravitational parameter (GM or μ) in m³/s². This is the product of Newton’s gravitational constant and the body’s mass.
Trait Implementations§
Source§impl Clone for LightContext
impl Clone for LightContext
Source§fn clone(&self) -> LightContext
fn clone(&self) -> LightContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LightContext
impl Debug for LightContext
Source§impl PartialEq for LightContext
impl PartialEq for LightContext
Source§fn eq(&self, other: &LightContext) -> bool
fn eq(&self, other: &LightContext) -> bool
self and other values to be equal, and is used by ==.