astromech/equation_core/two_body/field_potential.rs
1use crate::GRAVITATION_CONSTANT;
2/// Calculates the field potential
3///
4/// # Examples
5///
6/// ```
7/// let answer = astromech::calc_field_potential(4.0, 3.0);
8///
9/// assert_eq!(8.899066666666666e-11, answer);
10/// ```
11pub fn calc_field_potential(mass: f64, distance: f64) -> f64 {
12 (GRAVITATION_CONSTANT * mass) / distance
13}