Compute the convex hull of a set of points
This functionality does not run in MATLAB.
plot::hull computes the convex hull of a list of points in any dimension, i.e., the smallest convex region containing all the points. Such a region is bounded by simplices (straight lines in the plane, triangles in 3D) and it is these simplices which plot::hull returns.
Although plot::hull accepts and returns floating point values, the actual computations take place in hardware floating points and are therefore not affected by the value of DIGITS.
We generate a list of random points and compute their convex hull:
X := stats::uniformRandom(0, 20): l := [[X(), X()] $ i = 1..10]: h := plot::hull(l):
The convex hull is returned as lists of lists, as accepted by plot::Polygon2d:
plot(plot::PointList2d(l), plot::Polygon2d(t) $ t in h, Closed, PointSize=2)
The convex hull of a list of points in 3D is also easy to visualize:
l := [[x, y, z] $ y = z..x $ z = -x..x $ x = 0..10]: h := plot::hull(l): plot(plot::PointList3d(l, PointSize=1), plot::Polygon3d(t) $ t in h, Closed, Filled, FillColor=RGB::LightOrange.[0.6])
List of simplices of dimension one less than that of the points in L, given as lists of lists of floating-point values.