Compute the polygon normal from an array of points. This version assumes that the polygon is convex, and looks for the first valid normal. The point p0 is the origin of the local system, p10 is saxis vector, and p20 is the t-axis vector. The values l20 and l20 are the lengths of the vectors p10 and p20, and n is the polygon normal. Determine whether point is inside polygon.
Function uses ray-casting to determine if point is inside polygon.
Can also return -1 to indicate degenerate polygon. Tries to use the fast triangulation technique first, and if that doesn't work, uses more complex routine that is guaranteed to work. A fast triangulation method. Uses recursive divide and conquer based on plane splitting to reduce loop into triangles. Uses explicit analysis technique to split triangles into loops, which are recursively split until only triangles remain.