Determine if a path of coordinates encircles an object

18 Views Asked by At

from a series of x,y coordinates, drawn on a touchscreen, how could you determine that a user was 'approximately' circling some object?

like circled ads in a newspaper

it's easy to do this if the user has made a very nice attempt to circle the object with an oval-ish shape - but it gets much more difficult to distinguish an ellipse from a series of underlines, or other things which are not an attempt to circle something

you also don't know the coordinates of the object - that is to say, you have to determine, only from the series of coordinates, if the user was generally trying to draw ovals around something, and IF SO, then what?

and the oval might be at an angle - again, this is pretty easy to do if the user has made a nice oval, oriented perfectly to an axis, and there's only a few points; but people draw at angles, and touchscreens capture so many points that a LOT of the consecutive points end up being precisely horizontal, or precisely vertical from eachother