Mail Archives: djgpp/1998/03/27/20:05:59
This may be total nonsense, but it seems to me that you should be able
to compare the point's coordinates to the *average* location (+ or - 1/2
the size in X and Y) of the object's corner coordinates. This is easy to
see with a plain (all right angle) rectangle, but without testing it
could be absolute rubbish for non-regular objects.
Hope this gives you some ideas,
John Kissell
Steve Patton wrote:
>
> Hi,
>
> Is there a quick easy way to detect whether a point lies within the
> boundaries of a 2d polygon? Right now I'm dealing with a four sided
> polygon. This shape could be a rectangle (at any rotation angle, or
> distortion), trapazoid, etc, any 4 sided polygon. This has to be checked a
> LOT, so I would appreciate an efficient algorithm. Source code is not
> neccessary, if you can give me an idea, I can run with it. Thanks!
>
> --
> -Steve
> Personal : http://home.att.net/~pattonl
> Business : http://home.att.net/~pattonl/digital_resources.htm
- Raw text -