I'm working on a game in which I must find the convex hull for a set of points. I'm trying to choose the right algorithm. The sets of points are user-drawn shapes, so there is an order to them. Ideally, the user draws an ellipse, but they can draw anything as long as it is a single stroke. Some examples are below:
I want to find the convex hull of these shapes. All the convex hull algorithms I have found assume a random, orderless set of points. Which algorithm would be best for my particular situation, when the user has drawn the points by clicking and dragging the mouse, so the points are in order.
Notes:
In particular, many are output-sensitive algorithms. O(n log h) where n is the number of points in the set of all points, the original, and h is the set of points in the convex hull. With these shapes, I expect the h ~= n, because they are basically outlines in and of themselves.
Finally, the whole goal of this is to find the least-area rectangle of the points, such as this:
Can anyone think of a better way to find the rectangle other than first finding the convex hull? After research, this seems to be the best way, but my special case might be different.
Thank you in advance!