The point inclusion tests for polygons, in other words the point in polygon (PIP) algorithms are fundamental tools for many scientific fields related to computational geometry and they have been studied for a long time. PIP algorithms get direct or indirect geometric definition of a polygonal entity and validate its containment of a given point. The PIP algorithms which are working directly on the geometric entities derive linear boundary definitions for the edges of the polygon. Moreover, almost all direct test methods rely on the two point form of the line equation to partition the space into half-spaces. Voronoi tessellations use an alternate approach for half-space partitioning. Instead of line equation, distance comparison between generator points is used to accomplish the same task. Voronoi tessellations consist of convex polygons which are defined between generator points. Therefore, Voronoi tessellations have become an inspiration for us to develop a new approach of PIP testing specialized for convex polygons. Essential equations to the conversion of a convex polygon to a voronoi polygon are derived along this paper. As a reference, a very standard convex PIP testing algorithm, the sign of offset, is selected for comparison. For generalization of the comparisons the ray crossing algorithm is used as another reference. All algorithms are implemented as vector and matrix operations without any branching. This enabled us to benefit from the CPU optimizations of the underlying linear algebra libraries. All algorithms are tested for three different polygon sizes and varying point batch sizes. Overall, our proposed algorithm has performed better with varying margin between 10% to 23% compared to the reference methods.
[1]
Eric Haines,et al.
Point in Polygon Strategies
,
1994,
Graphics Gems.
[2]
Andrew S. Glassner,et al.
An introduction to ray tracing
,
1989
.
[3]
Paul A. Longley,et al.
Geographical information systems : principles, techniques, management, and applications
,
2005
.
[4]
Nicholas Chrisman,et al.
Cartographic Data Structures
,
1975
.
[5]
Stig Nordbeck,et al.
Computer cartography point-in-polygon programs
,
1967
.
[6]
Gaël Varoquaux,et al.
The NumPy Array: A Structure for Efficient Numerical Computation
,
2011,
Computing in Science & Engineering.
[7]
John D. Hunter,et al.
Matplotlib: A 2D Graphics Environment
,
2007,
Computing in Science & Engineering.
[8]
Julius Ziegler,et al.
Fast collision checking for intelligent vehicle motion planning
,
2010,
2010 IEEE Intelligent Vehicles Symposium.
[9]
Danna Zhou,et al.
d.
,
1840,
Microbial pathogenesis.
[10]
Paul R. Detmer,et al.
Centroid of a Polygon
,
1994,
Graphics Gems.
[11]
Eric Haines.
FAST RAY – CONVEX POLYHEDRON INTERSECTION
,
1991
.
[12]
Franziska Hoffmann,et al.
Spatial Tessellations Concepts And Applications Of Voronoi Diagrams
,
2016
.