Skip to main content

symmetric_difference

Function symmetric_difference 

Source
pub fn symmetric_difference(
    poly1: &Polygon,
    poly2: &Polygon,
) -> Result<Vec<Polygon>>
Expand description

Computes the symmetric difference of two polygons

Returns the area that is in either polygon but not in both. Equivalent to (poly1 - poly2) ∪ (poly2 - poly1).

§Arguments

  • poly1 - First polygon
  • poly2 - Second polygon

§Returns

Vector of polygons representing the symmetric difference

§Errors

Returns error if polygons are invalid