Name

cvxhull

Synopsis

int cvxhull(const List *P, List *polygon);

Return Value

0 if computing the convex hull is successful, or -1 otherwise.

Description

Computes the convex hull for a list of points specified in P. Each element in P must be of type Point . Since the cvxhull operation works in two dimensions, like lint, it ignores the z-coordinate in each Point structure. The convex hull is returned in polygon, which is a list of Point structures. The elements in polygon point to the actual points in P, so the caller must ensure that the storage in P remains valid as long as polygon is being accessed. Use list_destroy to destroy polygon once it is no longer needed.

Complexity

O (nh), where n is the total number of points, and h is the number of points in the convex hull.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.6.10