cartagen.hull_swinging_arm#
- hull_swinging_arm(points, length, direction='ccw')#
Create the hull of a set of points using the swinging arm algorithm.
This algorithm is described in Galton & Duckham. [1] Starting at the most northen point, iteratively create the border of a polygon by adding the first point intersecting the line (the arm) rotating around the point.
- Parameters:
- Returns:
See also
hull_delaunayCreate the hull of a set of points using the Delaunay triangulation.
Notes
This algorithm can create multiple polygons, unlike
hull_delaunay()References
Examples
>>> points = [ Point(1, 1), Point(6, 6), Point(1, 6), Point(6, 5), Point(2, 4), Point(2, 1), Point(1, 4) ] >>> swinging_arm(points, 5.0) [<POLYGON ((1 4, 1 1, 2 1, 2 4, 1 4))>]