Board index » delphi » is point inside the polygon

is point inside the polygon

How to determine if a given point is inside of a polygon?

Re:is point inside the polygon

Hi AKZ,

AKZ wrote in <3dc30...@newsgroups.borland.com>:

Quote
> How to determine if a given point is inside of a polygon?

Calculate a line and count all intersections. If the number of count
odd, the point is in the polygon. Be carefully on corner, move (rotate)
the line by a small difference to prevent a intersection with a corner.

A more simpler method is using the GDI functions CreatePolygonRgn and
PtInRegion.

Bye Peter.

Re:is point inside the polygon

Quote
"AKZ" <kzd...@freemail.org.mk> wrote in message

news:3dc30e48@newsgroups.borland.com...

Quote
> How to determine if a given point is inside of a polygon?

http://homepages.borland.com/efg2lab/Library/Delphi/Graphics/Math.htm

--
efg -- Earl F. Glynn, Overland Park, KS  USA

efg's Computer Lab:  http://www.efg2.com/Lab
Mirror:  http://homepages.borland.com/efg2lab/Default.htm

Re:is point inside the polygon

Check out the links in answers above, and for some background info (but with
examples in C) here:

http://astronomy.swin.edu.au/~pbourke/geometry/insidepoly/

This site gives a lot of useful info about geometric problems, so its worth
bookmarking.

Kind regards,

Nils Haeck
www.abc-view.com
www.simdesign.nl

Quote
"AKZ" <kzd...@freemail.org.mk> wrote in message

news:3dc30e48@newsgroups.borland.com...
Quote
> How to determine if a given point is inside of a polygon?

Re:is point inside the polygon

For the technically interested :
The lineintegral of the crossproduct between
distance vector to the point and the forward vector
is zero for a point outside. Or was it the dotproduct ?
Never mind, this should becomes simple for piecewise
lines.

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com
& commercial newsgroups - http://www.talkto.net

Quote
AKZ wrote:

> How to determine if a given point is inside of a polygon?