magnet.geometric_utils.convexHull_center#
- magnet.geometric_utils.convexHull_center(vertices: ndarray) ndarray #
Compute the centroid of the convex hull of a set of points.
- Parameters:
vertices (np.ndarray of float) – array of shape (N, 2), where N is the number of vertices of the polygon, containing the coordinates of its vertices.
- Returns:
The computed area.
- Return type:
float
Notes
In the 2D case, polygon_centroid is used for the computation. In the general case, we first find the Delaunay triangulation and then take a weighted average of all the simplices to find the centroid.