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

    for (coordinate, (low, high)) in s.coordinate_iter().zip(t.coordinates_iter()) {
        distance += if coordinate < low {
            (low - coordinate).powi(2)
        } else if coordinate > high {
            (coordinate - high).powi(2)
        } else {
            0.0
        };
    }

    distance
}
/// Returns the minimum distance between a point and a region.
Returns the minimum distance between a point and a region.
Returns the minimum distance between a point and a region .
fn min_distance_point_region(s: &Point, t: &Region) -> f64 {
    let mut distance = 0.0;
    for (coordinate, (low, high)) in s.coordinate_iter().zip(t.coordinates_iter()) {
        distance += if coordinate < low {
            (low - coordinate).powi(2)
        } else if coordinate > high {
            (coordinate - high).powi(2)
        } else {
            0.0
        };
    }
    distance
}
fn min_distance_point_region ( s : & Point , t : & Region ) -> f64 { let mut distance = 0.0 ; for ( coordinate , ( low , high ) ) in s . coordinate_iter ( ) . zip ( t . coordinates_iter ( ) ) { distance += if coordinate < low { ( low - coordinate ) . powi ( 2 ) } else if coordinate > high { ( coordinate - high ) . powi ( 2 ) } else { 0.0 } ; } distance }
Returns the minimum distance between a point and a region.
Returns the minimum distance between a point and a region .
s
&Point
t
&Region
s
&Point
t
&Region