is_point_in_polygon - Determines if a point is inside a polygon
Example compile flags (system dependent):
-DLINUX_X86_64 -DLINUX_X86_64_OPTERON -DGNU_COMPILER
-lKJB -lfftw3 -lgsl -lgslcblas -ljpeg -lSVM -lstdc++ -lpthread -lSLATEC -lg2c -lacml -lacml_mv -lblas -lg2c -lncursesw
const Matrix *points_mp,
const Vector *test_point_vp
This routine determines if a point, assumed to be co-planer with a convex
polygon, is inside that polygon. The polygon is specified by a list of points
in cyclic order placed in the rows of the matrix point_mp. The points can
be of any dimension, but this routine assumes that they lie in a 2-D
subspace. The boundary of the polygon is considered part of the polygon, so
if the point is on the boundary, then the routine returns TRUE.
TRUE if the point is inside the polygon, FALSE if not, and ERROR if there
are any problems, with an error message being set.
If the points are out of order, or if the polygon is not convex, or if
the point is not in the plane of the polygon, then this routine will not
Qhull output: The edges of facets of a 3D hull are not in cyclic order.
One solution is do call this routine for each triangle. Also, the edges
of a 2D hull are not in order, unless find_convex_hull() was called with
the ORDER_2D_HULL_FACETS option.
The algorithm used in this routine is not very good. Should be fixed
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.