The foundations of the computational method for determining if a point lies within the boundaries of a 2 dimensional polygon, relies on the concept of counting how many times a ray intersects within the boundary of the polygon. If the count of the number of times a ray intersects a polygon is odd, than the point lies within the polygon.
Read