geometry
convexhull
find the convex hull enclosing the given points
Calling Sequence
Parameters
Description
Examples
convexhull(ps)
ps
-
list or set of points
The convex hull of a set ps of points is the smallest convex polygon P for which each point in ps is either on the boundary of P or in its interior.
The result is returned as a list of points (vertices) of the convex polygon P in counter-clockwise order.
The routine uses an n⁢log⁡n algorithm computing tangents of pairs of points.
For an equivalent command with a few more options, see simplex[convexhull]. Input and output are simple points rather than geometric points, and the output can be the area enclosed in the polygon, the points defining the vertices, or a plot of the polygon.
The command with(geometry,convexhull) allows the use of the abbreviated form of this command.
with⁡geometry:
point⁡A,0,0,point⁡B,1,1,point⁡C,2,0,point⁡F,1,0,point⁡E1,1,12:
hullname≔convexhull⁡A,B,C,E1,F
hullname≔A,C,B
triangle⁡T,hullname:
draw⁡A,B,C,E1,F,T,printtext=true,axes=NONE
See Also
geometry[diameter]
simplex[convexhull]
Download Help Document