fn signed_distance(x: f64, y: f64, polygon: &Polygon) -> f64 {
    let point = Point { x, y };
    let inside = polygon.contains(&point);
    // Use LineString distance, because Polygon distance returns 0.0 for inside
    let distance = point.euclidean_distance_line_string(&polygon.exterior);
    if inside {
        distance
    } else {
        -distance
    }
}
/// Signed distance from a Qcell's centroid to a Polygon's outline
/// Returned value is negative if the point is outside the polygon's exterior ring
Signed distance from a Qcell's centroid to a Polygon's outline
Returned value is negative if the point is outside the polygon's exterior ring
Signed distance from a Qcell ' s centroid to a Polygon ' s outline Returned value is negative if the point is outside the polygon ' s exterior ring
fn signed_distance(x: f64, y: f64, polygon: &Polygon) -> f64 {
    let point = Point { x, y };
    let inside = polygon.contains(&point);
    // Use LineString distance, because Polygon distance returns 0.0 for inside
    let distance = point.euclidean_distance_line_string(&polygon.exterior);
    if inside {
        distance
    } else {
        -distance
    }
}
fn signed_distance ( x : f64 , y : f64 , polygon : & Polygon ) -> f64 { let point = Point { x , y } ; let inside = polygon . contains ( & point ) ; // Use LineString distance, because Polygon distance returns 0.0 for inside let distance = point . euclidean_distance_line_string ( & polygon . exterior ) ; if inside { distance } else { - distance } }
Signed distance from a Qcell's centroid to a Polygon's outline
Returned value is negative if the point is outside the polygon's exterior ring
Signed distance from a Qcell ' s centroid to a Polygon ' s outline Returned value is negative if the point is outside the polygon ' s exterior ring
x
f64
y
f64
polygon
&Polygon
x
f64
y
f64
polygon
&Polygon