Original Post
Hello. I'm using "number of intersections" method to check in my point inside or outside of my 2d shape. My shape have about 360 points. First, i'm creating a horisontal ray starting from my point and checking it for intersections with every small lines in my shape. Then i count the number of intersections. If this number is not even, then my point is inside. It works good, but sometimes it fails. It fails, because my ray can be colinear with the number of small lines (part of one edge for example), and it make inpossible to count right number of intersections. Please help, how to avoid this situation? Thanks!