Mercurial > hg > octave-lyh
diff scripts/geometry/inpolygon.m @ 13057:85c77dd2e85b
codesprint: tests for inpolygon
* inpolygon.m: New tests.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 03 Sep 2011 13:24:01 -0400 |
parents | c792872f8942 |
children | 72c96de7a403 |
line wrap: on
line diff
--- a/scripts/geometry/inpolygon.m +++ b/scripts/geometry/inpolygon.m @@ -130,3 +130,14 @@ %! disp("Green points are inside polygon, magenta are outside,"); %! disp("and blue are on boundary."); +%!error inpolygon (); +%!error inpolygon (1, 2); +%!error inpolygon (1, 2, 3); + +%!error inpolygon (1, [1,2], [3, 4], [5, 6]); +%!error inpolygon ([1,2], [3, 4], [5, 6], 1); + +%!test +%! [in, on] = inpolygon ([1, 0], [1, 0], [-1, -1, 1, 1], [-1, 1, 1, -1]); +%! assert (in, [false, true]); +%! assert (on, [true, false]);