[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Point inside/outside a polygon?

"Dennis Boccippio" <djboccip@hotmail.com> wrote in message
> Hi all,
> Does anyone know of IDL routines for determination of whether a point
> datum is inside/outside a closed irregular polygon?  I'm told that some
> variants of this functionality are available in Matlab and Mathematica,
> was curious if anyone had implemented a solution for IDL.  My usual
> kludge to this is polyfill/mask-based, which is probably a very
> inefficient approach...
> Thanks,
> Dennis Boccippio

Hi Dennis,

The IDLanROI class has a method named "ContainsPoints" to perform this
operation efficiently. It will let you know if a point lies exactly on an
edge or
vertex, or completely inside or outside the specified polygon. And it's also
good in three dimensions.  See the IDLanROIGroup class for extended

Jim P.