What I want is to find the smallest convex polygon that will fit around an essentially random set of points.
I figured was a well known problem, but it took me a while to find the proper geometric name for the problem, which is Convex Hull. Googling on that gives a lot of pages that address the problem.
Now I just have to pick an algorithm and implement it in PHP.
Not that it's going to be real easy. It's been so long since I have done anything like this I can't remember basic crud like checking if a point intersects a line.
Jay