The last article is considered for no circumference, please give the principle of the principle to do the right to the right, if the point of the ray and the polygon intersect, the point is in the polygon. Whether to intersect the judgment: 1. It is judged that the left or right side of the side (also possible on the extension line of the line segment) 2. The Y value of the judgment point is in the line segment between the two endpoint Y values (the left left) and if it is an odd number, the special case within the polygon is handled: the first case, the second case is considered No intersection (countless intersection), on the extension of the line segment
code show as below:
///
///
/// summary>
/// param>
/// param>
///
Public Static Int PtinPolygon (MAPPOINT MPPT, MAPPOLYGON PLY)
{
INT IRIGHTCROSS = 0; // Number of intersecting the rays and polygon
Mappoint mpnext = NULL; for (int i = 0; i