Suppose there is a polygon of N (and most importantly) vertices. And there is a point in an arbitrary place. It is necessary to determine whether it belongs to him or not. Points are represented as a structure:
struct point{ unsigned int x; unsigned int y;};
All solutions and algorithms that I found were written for quadrilaterals and for triangles. The main refinement polygon can be convex and not convex.
I stopped at the idea to calculate how many sides the beam emitted from the point passes. if an even number is not in a polygon. if not even - in a polygon. That is, we need to point vertices in a clockwise direction. Make the structure of the parties. But how to check? How to calculate these sides and make the intersection?