Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

https://web.cs.ucdavis.edu/~okreylos/TAship/Spring2000/PointInPolygon.html

Posted by lddlinan at 2021-04-06 22:52:21 on Problem 3506
    Initialize 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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator