JOIN
Get Time
forums   
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat (newest first)  | Threaded  | Tree
Previous Thread  |  Next Thread
PointInPolygon trick | Reply
Hi,
how about summing up the area(SUM_ALL) of all the triangles built-up by picking P(to be examined) and 2 points from given polygon set. If
SUM_ALL != REAL_SUM ( actual area of polygon) then point "EXTERIOR" else
INTERIOR or BOUNDARY , which can be easily sorted out.
Re: PointInPolygon trick (response to post by mohit_verma) | Reply
according to me , This is wrong .
As area of triangle is calculated by taking sum of area (taken with signs)
from a point P ( which may be anywhere ) , to pi, pi+1
So this area you are talking about will always be equal to actual area
Re: PointInPolygon trick (response to post by mohit_verma) | Reply
This works if the polygon is convex, but does not necessarily work otherwise.
Re: PointInPolygon trick (response to post by mohit_verma) | Reply
Another way to test whether a point is in a polygon is by looking at its winding number. It works for concave polygons too.
RSS