rust-roche 0.1.1

Rust translation of Tom Marsh's cpp-roche package for modelling Roche distorted stars/binary systems.
Documentation
///
/// zeta_rlobe_eggleton returns d log(rl) / d log (m2)
/// where rl is Peter Eggleton's formula for the volume-averaged 
/// Roche lobe radius divided by the orbital separation. This assumes
/// that m1+m2 = constant.
///
/// \param q mass ratio = M2/M1
/// \return Returns d log(rl) / d log (m2) where rl = Roche lobe radius of
/// secondary star divided by separation according to Eggleton's formula.
///
pub fn zeta_rlobe_eggleton(q: f64) -> f64 {
    let q1 = q.powf(1./3.);
    let loneq = (1. + q1).ln();
    (1. + q)/3.*(2.*loneq-q1/(1.+q1))/(0.6*q1*q1*loneq)
}


///
/// dzetadq_rlobe_eggleton returns d zeta / d q where zeta is the result 
/// of zeta_rlobe_eggleton(double q). This has been tested successfully
/// against finite difference value.
///
/// \param q mass ratio = M2/M1
/// \return Returns d zeta d q
///
pub fn dzetadq_rlobe_eggleton(q: f64) -> f64 {
    let q1 = q.powf(1./3.);
    let q2 = q1*q1;
    let opq1 = 1. + q1;
    let loneq = opq1.ln();
    let denom = 0.6*q2 + loneq;
    let numer = 2.*loneq - q1/opq1;
    numer/denom/3. + (1. + q)/3.*((1. + 2.*q1)/3./(q1*opq1).powi(2) - numer*(0.4/q1 + 1./(3.*q2*(1. + q1)))/denom)/denom
}