Check if a point is within a polygon, helper methods.