pub fn kothari_radius(mass: &f64, giant: &bool, zone: &i32) -> f64 {
    let mut atomic_weight = 0.0;
    let mut atomic_num = 0.0;

    match (zone, giant) {
        (1, true) => {
            atomic_weight = 9.5;
            atomic_num = 4.5;
        }
        (1, false) => {
            atomic_weight = 15.0;
            atomic_num = 8.0;
        }
        (2, true) => {
            atomic_weight = 2.47;
            atomic_num = 2.0;
        }
        (2, false) => {
            atomic_weight = 10.0;
            atomic_num = 5.0;
        }
        (3, true) => {
            atomic_weight = 7.0;
            atomic_num = 4.0;
        }
        (3, false) => {
            atomic_weight = 10.0;
            atomic_num = 5.0;
        }
        (_, _) => (),
    }

    let mut temp = atomic_weight * atomic_num;
    temp = 2.0 * BETA_20 * SOLAR_MASS_IN_GRAMS.powf(1.0 / 3.0)
        / (A1_20 * (temp as f64).powf(1.0 / 3.0));

    let mut temp2 = A2_20 * atomic_weight.powf(4.0 / 3.0) * SOLAR_MASS_IN_GRAMS.powf(2.0 / 3.0);
    temp2 *= mass.powf(2.0 / 3.0);
    temp2 /= A1_20 * atomic_num.powf(2.0);
    temp2 += 1.0;

    temp /= temp2;
    temp = (temp * mass.powf(1.0 / 3.0)) / CM_PER_KM;
    temp /= JIMS_FUDGE;

    temp
}
/// Returns the radius of the planet in kilometers.
/// The mass passed in is in units of solar masses, the orbital radius in A.U.
/// This formula is listed as eq.9 in Fogg's article, although some typos crop up in that eq. See "The Internal Constitution of Planets", by Dr. D. S. Kothari, Mon. Not. of the Royal Astronomical Society, vol 96 pp.833-843, 1936 for the derivation. Specifically, this is Kothari's eq.23, which appears on page 840.
Returns the radius of the planet in kilometers.
The mass passed in is in units of solar masses, the orbital radius in A.U.
This formula is listed as eq.9 in Fogg's article, although some typos crop up in that eq. See "The Internal Constitution of Planets", by Dr. D. S. Kothari, Mon. Not. of the Royal Astronomical Society, vol 96 pp.833-843, 1936 for the derivation. Specifically, this is Kothari's eq.23, which appears on page 840.
Returns the radius of the planet in kilometers . The mass passed in is in units of solar masses the orbital radius in A . U . This formula is listed as eq . 9 in Fogg ' s article although some typos crop up in that eq . See " The Internal Constitution of Planets " by Dr . D . S . Kothari Mon . Not . of the Royal Astronomical Society vol 96 pp . 833 - 843 1936 for the derivation . Specifically this is Kothari ' s eq . 23 which appears on page 840 .
pub fn kothari_radius(mass: &f64, giant: &bool, zone: &i32) -> f64 {
    let mut atomic_weight = 0.0;
    let mut atomic_num = 0.0;
    match (zone, giant) {
        (1, true) => {
            atomic_weight = 9.5;
            atomic_num = 4.5;
        }
        (1, false) => {
            atomic_weight = 15.0;
            atomic_num = 8.0;
        }
        (2, true) => {
            atomic_weight = 2.47;
            atomic_num = 2.0;
        }
        (2, false) => {
            atomic_weight = 10.0;
            atomic_num = 5.0;
        }
        (3, true) => {
            atomic_weight = 7.0;
            atomic_num = 4.0;
        }
        (3, false) => {
            atomic_weight = 10.0;
            atomic_num = 5.0;
        }
        (_, _) => (),
    }
    let mut temp = atomic_weight * atomic_num;
    temp = 2.0 * BETA_20 * SOLAR_MASS_IN_GRAMS.powf(1.0 / 3.0)
        / (A1_20 * (temp as f64).powf(1.0 / 3.0));
    let mut temp2 = A2_20 * atomic_weight.powf(4.0 / 3.0) * SOLAR_MASS_IN_GRAMS.powf(2.0 / 3.0);
    temp2 *= mass.powf(2.0 / 3.0);
    temp2 /= A1_20 * atomic_num.powf(2.0);
    temp2 += 1.0;
    temp /= temp2;
    temp = (temp * mass.powf(1.0 / 3.0)) / CM_PER_KM;
    temp /= JIMS_FUDGE;
    temp
}
pub fn kothari_radius ( mass : & f64 , giant : & bool , zone : & i32 ) -> f64 { let mut atomic_weight = 0.0 ; let mut atomic_num = 0.0 ; match ( zone , giant ) { ( 1 , true ) => { atomic_weight = 9.5 ; atomic_num = 4.5 ; } ( 1 , false ) => { atomic_weight = 15.0 ; atomic_num = 8.0 ; } ( 2 , true ) => { atomic_weight = 2.47 ; atomic_num = 2.0 ; } ( 2 , false ) => { atomic_weight = 10.0 ; atomic_num = 5.0 ; } ( 3 , true ) => { atomic_weight = 7.0 ; atomic_num = 4.0 ; } ( 3 , false ) => { atomic_weight = 10.0 ; atomic_num = 5.0 ; } ( _ , _ ) => ( ) , } let mut temp = atomic_weight * atomic_num ; temp = 2.0 * BETA_20 * SOLAR_MASS_IN_GRAMS . powf ( 1.0 / 3.0 ) / ( A1_20 * ( temp as f64 ) . powf ( 1.0 / 3.0 ) ) ; let mut temp2 = A2_20 * atomic_weight . powf ( 4.0 / 3.0 ) * SOLAR_MASS_IN_GRAMS . powf ( 2.0 / 3.0 ) ; temp2 *= mass . powf ( 2.0 / 3.0 ) ; temp2 /= A1_20 * atomic_num . powf ( 2.0 ) ; temp2 += 1.0 ; temp /= temp2 ; temp = ( temp * mass . powf ( 1.0 / 3.0 ) ) / CM_PER_KM ; temp /= JIMS_FUDGE ; temp }
Returns the radius of the planet in kilometers.
Returns the radius of the planet in kilometers .
mass
&f64
giant
&bool
zone
&i32
mass
&f64
giant
&bool
zone
&i32