This is a standard task of geodesy at the entry point in the polygon is solved by slanting the multiplication of two vectors.
In fact, we move all the segments of a polygon and looks which side of the segment the point lies in. Count the number of all cases when it lies to the right of the line (i.e. intersects when turning), filter out all segments that lie above or below the point. If the number on the right is even or zero, then the point in the polygon is not included, if odd, therefore lies inside the polygon.
Code is solved in five lines.
PS: found my answer
two years ago)