Check if a point is inside a polygon using ray casting algorithm. Casts a ray from the point to the right and counts edge intersections. If odd number of intersections, point is inside; if even, point is outside.