Find if a point is in or out the polygon

Question posted in Computer Software on 03 2010
Rate question difficulty level 0 Votes
Given an irregular shaped polygon, how would you determine whether a particular point is inside or outside of the polygon?
 
 
4 Answers
 
Starting from the given point, trace a ray in any direction, counting the number of times that the ray crosses a line segment in the polygon. If the number of times that it crosses a line segment is odd then the point is inside of the polygon, otherwise it is outside.

03/24/2010
 
 
Wow! Great tnhiknig! JK

01/01/2012
 
 
 
 
 
 
Add an answer*
 
Your name
Email
 
Company: Microsoft
Location: United States
puzzle algorithem

add a question

arrow_blue


Now hiring!
---------------------------
---------------------------
---------------------------
---------------------------
---------------------------
---------------------------
---------------------------