fn attractive_part(params: &Params, distsq: f64, r: V3) -> (f64, V3) {
    debug_assert_eq!(distsq, r.sqnorm());

    let z0_div_distsq = (params.z0 * params.z0) / distsq;

    // A * (z_0 / rho)^6
    let value = -params.A * (z0_div_distsq * z0_div_distsq * z0_div_distsq);
    let d_r = -6.0 * r * value / distsq;
    dbg!("VA: {:.9}", value);

    (value, d_r)
}
/// The attractive part of the potential.
The attractive part of the potential.
The attractive part of the potential .
fn attractive_part(params: &Params, distsq: f64, r: V3) -> (f64, V3) {
    debug_assert_eq!(distsq, r.sqnorm());
    let z0_div_distsq = (params.z0 * params.z0) / distsq;
    // A * (z_0 / rho)^6
    let value = -params.A * (z0_div_distsq * z0_div_distsq * z0_div_distsq);
    let d_r = -6.0 * r * value / distsq;
    dbg!("VA: {:.9}", value);
    (value, d_r)
}
fn attractive_part ( params : & Params , distsq : f64 , r : V3 ) -> ( f64 , V3 ) { debug_assert_eq ! ( distsq r sqnorm ( ) ) ; let z0_div_distsq = ( params . z0 * params . z0 ) / distsq ; // A * (z_0 / rho)^6 let value = - params . A * ( z0_div_distsq * z0_div_distsq * z0_div_distsq ) ; let d_r = - 6.0 * r * value / distsq ; dbg ! ( " " value ) ; ( value , d_r ) }
The attractive part of the potential.
The attractive part of the potential .
params
&Params
distsq
f64
r
V3
params
&Params
distsq
f64
r
V3