Skip to main content

circular_orbital_speed

Function circular_orbital_speed 

pub fn circular_orbital_speed(mu: f64, orbital_radius: f64) -> Option<f64>
Expand description

Computes the speed for a circular orbit at a radius around a body with gravitational parameter.

Formula: v = sqrt(μ / r)

Returns None when mu is negative, when orbital_radius is less than or equal to zero, or when the input or result is not finite.

§Examples

use use_orbit::circular_orbital_speed;

let speed = circular_orbital_speed(398_600_441_800_000.0, 6_371_000.0);

assert!(speed.is_some_and(|value| (value - 7_909.8).abs() < 1.0));