Elsevier Science Home
Computer Physics Communications Program Library
Full text online from Science Direct
Programs in Physics & Physical Chemistry
CPC Home

[Licence| Download | New Version Template] aabj_v1_0.gz(2 Kbytes)
Manuscript Title: Checking if a point lies inside a polygon.
Authors: C. Wooff
Program title: INPOLY
Catalogue identifier: AABJ_v1_0
Distribution format: gz
Journal reference: Comput. Phys. Commun. 36(1985)219
Programming language: Fortran.
Computer: GEC 4190.
Operating system: OS4000/MVT.
RAM: 1K words
Word size: 32
Keywords: General purpose, Coordinate geometry, Plot, Vector algebra, Polygon.
Classification: 14.

Nature of problem:
The program determines whether a given point lies inside, outside or on the sides of a given polygon.

Solution method:
Lines are constructed between the given point and each vertex of the polygon. If the sum of the angles between these lines is zero then the point lines outside the polygon.


Unusual features:

Running time:
On the 4190 for a polygon with 16 vertices the running time is approximately 10 milliseconds per point.