fn min_distance_region(s: &Region, t: &Region) -> f64 {
    let mut distance = 0.0;

    for ((s_low, s_high), (t_low, t_high)) in s.coordinates_iter().zip(t.coordinates_iter()) {
        let x = {
            if t_high < s_low {
                (t_high - s_low).abs()
            } else if s_high < t_low {
                (t_low - s_high).abs()
            } else {
                0.0
            }
        };

        distance += x * x;
    }

    distance
}
/// Returns the minimum distance between two regions.
Returns the minimum distance between two regions.
Returns the minimum distance between two regions .
fn min_distance_region(s: &Region, t: &Region) -> f64 {
    let mut distance = 0.0;
    for ((s_low, s_high), (t_low, t_high)) in s.coordinates_iter().zip(t.coordinates_iter()) {
        let x = {
            if t_high < s_low {
                (t_high - s_low).abs()
            } else if s_high < t_low {
                (t_low - s_high).abs()
            } else {
                0.0
            }
        };
        distance += x * x;
    }
    distance
}
fn min_distance_region ( s : & Region , t : & Region ) -> f64 { let mut distance = 0.0 ; for ( ( s_low , s_high ) , ( t_low , t_high ) ) in s . coordinates_iter ( ) . zip ( t . coordinates_iter ( ) ) { let x = { if t_high < s_low { ( t_high - s_low ) . abs ( ) } else if s_high < t_low { ( t_low - s_high ) . abs ( ) } else { 0.0 } } ; distance += x * x ; } distance }
Returns the minimum distance between two regions.
Returns the minimum distance between two regions .
s
&Region
t
&Region
s
&Region
t
&Region