diff doc/interpreter/geometry.txi @ 6847:956148c0d388

[project @ 2007-08-30 07:39:32 by dbateman]
author dbateman
date Thu, 30 Aug 2007 07:42:35 +0000
parents 3c500bc71e14
children a052825889a0
line wrap: on
line diff
--- a/doc/interpreter/geometry.txi	Thu Aug 30 07:25:57 2007 +0000
+++ b/doc/interpreter/geometry.txi	Thu Aug 30 07:42:35 2007 +0000
@@ -298,8 +298,9 @@
 @end float
 @end ifnotinfo
 
-Additional information about the size of the facets of a Voronoi diagram
-can be had with the @code{polyarea} function.
+Additional information about the size of the facets of a Voronoi
+diagram, and which points of a set of points is in a polygon can be had
+with the @code{polyarea} and @code{inpolygon} functions respectively.
 
 @DOCSTRING(polyarea)
 
@@ -320,6 +321,34 @@
 
 Facets of the Voronoi diagram with a vertex at infinity have infinity area.
 
+@DOCSTRING(inpolygon)
+
+An example of the use of @code{inpolygon} might be
+
+@example
+@group
+randn ("state", 2);
+x = randn (100, 1);
+y = randn (100, 1);
+vx = cos (pi * [-1 : 0.1: 1]);
+vy = sin (pi * [-1 : 0.1 : 1]);
+in = inpolygon (x, y, vx, vy);
+plot(vx, vy, x(in), y(in), "r+", x(!in), y(!in), "bo");
+axis ([-2, 2, -2, 2]);
+@end group
+@end example
+
+@ifnotinfo
+@noindent
+The result of which can be seen in @ref{fig:inpolygon}.
+
+@float Figure,fig:inpolygon
+@image{inpolygon,8cm}
+@caption{Demonstration of the @code{inpolygon} function to determine the
+points inside a polygon}
+@end float
+@end ifnotinfo
+
 @node Convex Hull
 @section Convex Hull