Mercurial > octave
changeset 31894:129e5fc5372b stable
maint: Merge away extra head on stable
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 07 Mar 2023 16:02:10 -0500 |
parents | fe1704313ec3 (current diff) 9de99cd1f9d7 (diff) |
children | 1566f2dff418 75ef035f851e |
files | |
diffstat | 1 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/geometry/inpolygon.m Tue Mar 07 01:01:42 2023 -0500 +++ b/scripts/geometry/inpolygon.m Tue Mar 07 16:02:10 2023 -0500 @@ -39,9 +39,9 @@ ## @end deftypefn ## Algorithm: The method for determining if a point is in a polygon is based on -## the algorithm shown on -## http://local.wasp.uwa.edu.au/~pbourke/geometry/insidepoly/ -## and is credited to Randolph Franklin. +## the PnPoly algorithm from Prof W. Randolph Franklin, +## (Rensselaer Polytechnic Institute, Troy NY), originally written in 1970. +## URL: http://wrfranklin.org/pnpoly function [in, on] = inpolygon (x, y, xv, yv) @@ -104,12 +104,12 @@ %! clf; %! plot (xv, yv); %! hold on; -%! plot (x(inside), y(inside), "@g"); -%! plot (x(! in), y(! in), "@m"); -%! plot (x(on), y(on), "@b"); +%! plot (x(inside), y(inside), "og"); +%! plot (x(! in), y(! in), "sm"); +%! plot (x(on), y(on), "^b"); %! hold off; -%! disp ("Green points are inside polygon, magenta are outside,"); -%! disp ("and blue are on boundary."); +%! disp ("Green circles are inside polygon, magenta squares are outside,"); +%! disp ("and blue triangles are on the boundary."); %!demo %! xv = [ 0.05840, 0.48375, 0.69356, 1.47478, 1.32158, ... @@ -129,12 +129,12 @@ %! clf; %! plot (xv, yv); %! hold on; -%! plot (x(inside), y(inside), "@g"); -%! plot (x(! in), y(! in), "@m"); -%! plot (x(on), y(on), "@b"); +%! plot (x(inside), y(inside), "og"); +%! plot (x(! in), y(! in), "sm"); +%! plot (x(on), y(on), "^b"); %! hold off; -%! disp ("Green points are inside polygon, magenta are outside,"); -%! disp ("and blue are on boundary."); +%! disp ("Green circles are inside polygon, magenta squares are outside,"); +%! disp ("and blue triangles are on the boundary."); %!test %! [in, on] = inpolygon ([1, 0, 2], [1, 0, 0], [-1, -1, 1, 1], [-1, 1, 1, -1]);