In computational geometry, the point-in-polygon (PIP) problem asks whether a given point in the plane lies inside, outside, or on the boundary of a polygon. It is a special case of point location problems and finds applications in areas that deal with processing geometrical data, such as computer graphics, computer vision, geographic information systems (GIS), motion planning, and computer-aided design (CAD). An early description of the problem in computer graphics shows two common approaches (ray casting and angle summation) in use as early as 1974. An attempt of computer graphics veterans to trace the history of the problem and some tricks for its solution can be found in an issue of the Ray Tracing News. Jordan curve theorem One simple way of finding whether the point is inside or outside a simple polygon is to test how many times a ray, starting from the point and going in any fixed direction, intersects the edges of the polygon. If the point is on the outside of the polygon the ray will intersect its edge an even number of times. If the point is on the inside of the polygon then it will intersect the edge an odd number of times. The status of a point on the edge of the polygon depends on the details of the ray intersection algorithm. This algorithm is sometimes also known as the crossing number algorithm or the even–odd rule algorithm, and was known as early as 1962. The algorithm is based on a simple observation that if a point moves along a ray from infinity to the probe point and if it crosses the boundary of a polygon, possibly several times, then it alternately goes from the outside to inside, then from the inside to the outside, etc. As a result, after every two "border crossings" the moving point goes outside. This observation may be mathematically proved using the Jordan curve theorem. If implemented on a computer with finite precision arithmetics, the results may be incorrect if the point lies very close to that boundary, because of rounding errors.

About this result
This page is automatically generated and may contain information that is not correct, complete, up-to-date, or relevant to your search query. The same applies to every other page on this website. Please make sure to verify the information with EPFL's official sources.
Related courses (5)
CH-353: Introduction to electronic structure methods
Repetition of the basic concepts of quantum mechanics and main numerical algorithms used for practical implementions. Basic principles of electronic structure methods:Hartree-Fock, many body perturbat
MATH-410: Riemann surfaces
This course is an introduction to the theory of Riemann surfaces. Riemann surfaces naturally appear is mathematics in many different ways: as a result of analytic continuation, as quotients of complex
CH-450: Solid state chemistry and energy applications
You will learn about the bonding and structure of several important families of solid state materials. You will gain insight into common synthetic and characterization methods and learn about the appl
Show more
Related lectures (37)
Modeling Class: Vesta Software Visualization
Explores crystal structure visualization using Vesta software for CCP and HCP arrangements.
Basis Sets I
Explores the solution of the Schrödinger equation for many-electron systems using basis sets and the concept of basis functions.
Configuration Interaction II: Correlation Energy and CSF's
Explores the calculation of correlation energy and CSF's in electronic structure calculations.
Show more
Related publications (18)

Quadratic serendipity element shape functions on general planar polygons

Xiaodong Wei, Juan Cao

This paper proposes a method for the construction of quadratic serendipity element (QSE) shape functions on planar convex and concave polygons. Existing approaches for constructing QSE shape functions are linear combinations of the pair-wise products of ge ...
ELSEVIER SCIENCE SA2022

Robust numerical integration on curved polyhedra based on folded decompositions

Annalisa Buffa, Pablo Antolin Sanchez, Xiaodong Wei

We present a novel method to perform numerical integration over curved polyhedra enclosed by high-order parametric surfaces. Such a polyhedron is first decomposed into a set of triangular and/or rectangular pyramids, whose certain faces correspond to the g ...
ELSEVIER SCIENCE SA2022

Localizing Polygonal Objects in Man-Made Environments

Xiaolu Sun

Object detection is a significant challenge in Computer Vision and has received a lot of attention in the field. One such challenge addressed in this thesis is the detection of polygonal objects, which are prevalent in man-made environments. Shape analysis ...
EPFL2015
Show more
Related concepts (3)
Simple polygon
In geometry, a simple polygon is a polygon that does not intersect itself and has no holes. That is, they are piecewise-linear Jordan curves consisting of finitely many line segments. They include as special cases the convex polygons, star-shaped polygons, and monotone polygons. The sum of external angles of a simple polygon is . Every simple polygon with sides can be triangulated by of its diagonals, and by the art gallery theorem its interior is visible from some of its vertices.
Jordan curve theorem
In topology, the Jordan curve theorem asserts that every Jordan curve (a plane simple closed curve) divides the plane into an "interior" region bounded by the curve and an "exterior" region containing all of the nearby and far away exterior points. Every continuous path connecting a point of one region to a point of the other intersects with the curve somewhere. While the theorem seems intuitively obvious, it takes some ingenuity to prove it by elementary means.
Computational geometry
Computational geometry is a branch of computer science devoted to the study of algorithms which can be stated in terms of geometry. Some purely geometrical problems arise out of the study of computational geometric algorithms, and such problems are also considered to be part of computational geometry. While modern computational geometry is a recent development, it is one of the oldest fields of computing with a history stretching back to antiquity.
Related MOOCs (8)
Introduction to Geographic Information Systems (part 1)
Organisé en deux parties, ce cours présente les bases théoriques et pratiques des systèmes d’information géographique, ne nécessitant pas de connaissances préalables en informatique. En suivant cette
Introduction to Geographic Information Systems (part 1)
Organisé en deux parties, ce cours présente les bases théoriques et pratiques des systèmes d’information géographique, ne nécessitant pas de connaissances préalables en informatique. En suivant cette
Geographical Information Systems 1
Organisé en deux parties, ce cours présente les bases théoriques et pratiques des systèmes d’information géographique, ne nécessitant pas de connaissances préalables en informatique. En suivant cette
Show more

Graph Chatbot

Chat with Graph Search

Ask any question about EPFL courses, lectures, exercises, research, news, etc. or try the example questions below.

DISCLAIMER: The Graph Chatbot is not programmed to provide explicit or categorical answers to your questions. Rather, it transforms your questions into API requests that are distributed across the various IT services officially administered by EPFL. Its purpose is solely to collect and recommend relevant references to content that you can explore to help you answer your questions.