Skip to main content

gravitational_parameter

Function gravitational_parameter 

Source
pub fn gravitational_parameter(source_mass: f64) -> Option<f64>
Expand description

Computes the standard gravitational parameter from a source mass.

Formula: μ = G * M

Returns None when source_mass is negative, when the input is not finite, or when the result is not finite.

§Examples

use use_orbit::{GRAVITATIONAL_CONSTANT, gravitational_parameter};

assert_eq!(gravitational_parameter(1.0), Some(GRAVITATIONAL_CONSTANT));