A Simple and Correct Even-Odd Algorithm for the Point-in-Polygon Problem for Complex Polygons

Michael Galetzka, Patrick Glauner

Abstract

Determining if a point is in a polygon or not is used by a lot of applications in computer graphics, computer games and geoinformatics. Implementing this check is error-prone since there are many special cases to be considered. This holds true in particular for complex polygons whose edges intersect each other creating holes. In this paper we present a simple even-odd algorithm to solve this problem for complex polygons in linear time and prove its correctness for all possible points and polygons. We furthermore provide examples and implementation notes for this algorithm.

References

  1. Foley, J. D., van Dam, A., Feiner, S. K. and Hughes, J. F. (1990). Computer Graphics: Principles and Practice. The Systems Programming Series. 2nd Edition. Addison-Wesley, Reading.
  2. Hormann, K. and Agathos, A. (2001). The point in polygon problem for arbitrary polygons. Computational Geometry, 20(3):131-144.
  3. Schirra, S. (2008). How reliable are practical pointin-polygon strategies? Algorithms - ESA 2008, 5193:744-755.
  4. Sedgewick, R. (1992). Algorithms in C++. 1st Edition. Addison-Wesley Professional.
  5. Stueker, D. (1999). Line segment intersection and inclusion in a polygon. Elementary geometric methods.
  6. Tverberg, H. (1980). A proof of the jordan curve theorem. Bulletin of the London Mathematical Society, 12(1):34-38.
  7. Zalik, B. and Kolingerova, I. (2001). A cell-based pointin-polygon algorithm suitable for large sets of points. Computers and Geosciences, 27(10):1135 - 1145.
Download


Paper Citation


in Harvard Style

Galetzka M. and Glauner P. (2017). A Simple and Correct Even-Odd Algorithm for the Point-in-Polygon Problem for Complex Polygons . In Proceedings of the 12th International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications - Volume 1: GRAPP, (VISIGRAPP 2017) ISBN 978-989-758-224-0, pages 175-178. DOI: 10.5220/0006040801750178


in Bibtex Style

@conference{grapp17,
author={Michael Galetzka and Patrick Glauner},
title={A Simple and Correct Even-Odd Algorithm for the Point-in-Polygon Problem for Complex Polygons},
booktitle={Proceedings of the 12th International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications - Volume 1: GRAPP, (VISIGRAPP 2017)},
year={2017},
pages={175-178},
publisher={SciTePress},
organization={INSTICC},
doi={10.5220/0006040801750178},
isbn={978-989-758-224-0},
}


in EndNote Style

TY - CONF
JO - Proceedings of the 12th International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications - Volume 1: GRAPP, (VISIGRAPP 2017)
TI - A Simple and Correct Even-Odd Algorithm for the Point-in-Polygon Problem for Complex Polygons
SN - 978-989-758-224-0
AU - Galetzka M.
AU - Glauner P.
PY - 2017
SP - 175
EP - 178
DO - 10.5220/0006040801750178