pub fn empirical_density(
    mass: &f64,
    distance_to_primary_star: &f64,
    ecosphere_radius: &f64,
    is_gas_giant: &bool,
) -> f64 {
    let mut density = (mass * EARTH_MASSES_PER_SOLAR_MASS).powf(1.0 / 8.0);
    density *= (ecosphere_radius / distance_to_primary_star).powf(0.25);

    match is_gas_giant {
        true => density * 1.2,
        false => density * 5.5,
    }
}
/// The mass passed in is in units of solar masses, and the orbital radius is in units of AU. The density is returned in units of grams/cc.
The mass passed in is in units of solar masses, and the orbital radius is in units of AU. The density is returned in units of grams/cc.
The mass passed in is in units of solar masses and the orbital radius is in units of AU . The density is returned in units of grams / cc .
pub fn empirical_density(
    mass: &f64,
    distance_to_primary_star: &f64,
    ecosphere_radius: &f64,
    is_gas_giant: &bool,
) -> f64 {
    let mut density = (mass * EARTH_MASSES_PER_SOLAR_MASS).powf(1.0 / 8.0);
    density *= (ecosphere_radius / distance_to_primary_star).powf(0.25);
    match is_gas_giant {
        true => density * 1.2,
        false => density * 5.5,
    }
}
pub fn empirical_density ( mass : & f64 , distance_to_primary_star : & f64 , ecosphere_radius : & f64 , is_gas_giant : & bool , ) -> f64 { let mut density = ( mass * EARTH_MASSES_PER_SOLAR_MASS ) . powf ( 1.0 / 8.0 ) ; density *= ( ecosphere_radius / distance_to_primary_star ) . powf ( 0.25 ) ; match is_gas_giant { true => density * 1.2 , false => density * 5.5 , } }
The mass passed in is in units of solar masses, and the orbital radius is in units of AU.
The mass passed in is in units of solar masses and the orbital radius is in units of AU .
mass
&f64
distance_to_primary_star
&f64
ecosphere_radius
&f64
is_gas_giant
&bool
mass
&f64
distance_to_primary_star
&f64
ecosphere_radius
&f64
is_gas_giant
&bool