PointInPolygon:

Path: Math/Geometry

% Determine whether points p are in polygon v.

   The polygon is formed by edges
   v(:,1) -> v(:,2) -> ... v(:,end) -> v(:,1)

   Type PointInPolygon for a demo.

   If no outputs are specified it will draw the polygon and the points.

--------------------------------------------------------------------------
   Form:
   r = PointInPolygon( p, v )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   p             (2,n) Points
   v             (2,m) Vertices of polygon

   -------
   Outputs
   -------
   r             (1,n) 1 = yes

--------------------------------------------------------------------------
   Reference: W. Randolf Franklin
   http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
--------------------------------------------------------------------------

Children:

Common: Graphics/NewFig

Back to the Math Module page