Computing convex hulls
A geometric figure is said to be convex if every pair of points within the figure can be joined using a straight line that is also contained within the figure. Simple examples of convex bodies include points, straight lines, squares, circles (disks), regular polygons, and so on. The geometric figure shown in Figure 8.5 is not convex since the points on the opposite sides of the hole cannot be connected by a straight line that remains inside the figure.
Convex figures are simple from a certain perspective, which means they are useful in a variety of applications. One problem involves finding the smallest convex set that contains a collection of points. This smallest convex set is called the convex hull of the set of points.
In this recipe, we’ll learn how to find the convex hull of a set of points using the Shapely package.
Getting ready
For this recipe, we will need the NumPy package imported as np
, the Matplotlib package imported as mpl
, and...