Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
https://web.cs.ucdavis.edu/~okreylos/TAship/Spring2000/PointInPolygon.htmlInitialize intersectionCount to zero. For each edge e of Q, defined by p1 and p2, check the following: If p1y < Py and p2y < Py, do nothing (both points are in region R1). If p1y >= Py and p2y >= Py, do nothing (both points are in region R2). Otherwise, calculate the intersection point S of edge e and the line y = Py. If Sx >= Px, increment intersectionCount. After all edges have been checked, P is inside Q, if and only if intersectionCount is odd. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator