cartagen.polygon_concavity

cartagen.polygon_concavity#

polygon_concavity(polygon)#

Calculate the concavity of a polygon.

This function calculates the concavity of a polygon as its area divided by the area of its convex hull.

Parameters:

polygon (Polygon) – The polygon to calculated the concavity from.

Returns:

float

Examples

>>> polygon = Polygon([(0, 0), (0, 2), (1, 1), (2, 2), (2, 0), (0, 0)])
>>> polygon_concavity(polygon)
0.75

(Source code)