liba 0.1.15
An algorithm library based on C/C++
Loading...
Searching...
No Matches
convex hull algorithms
Collaboration diagram for convex hull algorithms:

Functions

a_size a_convexhull2 (a_point2 *__restrict i_p, a_size i_n, a_point2 *__restrict o_p, a_size o_n, a_uint opt, a_real tol)
 compute the convex hull of a set of 2D points using the Monotone Chain algorithm.

Detailed Description

Function Documentation

◆ a_convexhull2()

a_size a_convexhull2 ( a_point2 *__restrict i_p,
a_size i_n,
a_point2 *__restrict o_p,
a_size o_n,
a_uint opt,
a_real tol )

compute the convex hull of a set of 2D points using the Monotone Chain algorithm.

Parameters
[in,out]i_ppoints to the input 2D points in memory
[in]i_nnumber of the input 2D points in memory
[out]o_ppoints to the output memory where the convex hull points will be stored
[in]o_nnumber of the output memory where the convex hull points will be stored
[in]optIn-place sort option for the pre-processing step. If the following values are not used, assume the input points are ordered.
  • 'x'/'X' sort points primarily by X-coordinate, then by Y-coordinate.
  • 'y'/'Y' sort points primarily by Y-coordinate, then by X-coordinate.
[in]toltolerance value for collinearity checks
Returns
the number of points in the computed convex hull
Return values
0if the output memory is too small to hold the result