Carter A. answered 04/16/20
Experienced software developer using object-oriented Java
I assume you mean a convex polygon, one that contains all of the points on or within it. My approach is to write a routine that can determine if a given point is on or within a polygon composed of a set of points. The algorithm is to start with each point as a starting point. Add each remaining point in turn to the polygon if it is outside the polygon (initially they all would be) then add it to the polygon and recurse. When you reach a point where all of the points not in the polygon set are inside the polygon, you are done.
This certainly works in one dimension. It ends up with the least and greatest value containing all the others. The inside function for xl(east) and xg(reater) is xl <= x <= xg. If there are no ties, two values define a line segment. In two dimensions, we observe that a point is inside a polygon if it is inside of at least one triangle composed of three points in the polygon. In three dimensions, we observe that a point is inside of a polygon if it is inside of at least one tetrahedron formed by four points. It is obvious that this can be extended to higher dimensionalities.