Mercurial > hg > octave-lyh
changeset 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 | 66662c033301 |
children | 14422cc782b2 |
files | scripts/geometry/inpolygon.m |
diffstat | 1 files changed, 11 insertions(+), 0 deletions(-) [+] |
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]);