cartagen.polygon_elongation

cartagen.polygon_elongation#

polygon_elongation(polygon)#

Calculate the elongation of a polygon.

This function calculates the elongation of a polygon using the minimum_rotated_rectangle. It is the ratio between the length and the width of this rectangle.

Parameters:

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

Returns:

float

Examples

>>> polygon = Polygon([(0, 0), (0, 1), (2, 1), (2, 0), (0, 0)])
>>> polygon_elongation(polygon)
2.0

(Source code)