To find a point inside a polygon

Janos Blazi jblazi at netsurf.de
Wed Jan 26 15:52:21 EST 2000


You find the algorithm in the book Computational Geometry by
Preparata-Shamos (if I remember correctly the title) and in many other books
on computational geometry. The implementation should be very simple
(actually Python is an extremely friendly language and the method is
simple).

The basic idea is to draw a line through the point and count how often this
line intersects the boundaries of the polygon.

J.B.

David Yeung <dyeung at ust.hk> schrieb in im Newsbeitrag:
388F0E36.6CE37135 at ust.hk...
> Does anyone know if any python implementation for finding whether a point
> is inside a polygon? E.g., by giving a point(x,y) and an array of
polygon's
> points (x0,y0,x1,y1,x2,y2,...), it returns true or false to tell if the
> given (x,y) is inside the polygon.
>
> Thanks
>
> david




  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----



More information about the Python-list mailing list