>> help inpoly
inpoly: Point-in-polygon testing.
Determine whether a series of points lie within the bounds of a polygon
in the 2D plane. General non-convex, multiply-connected polygonal
regions can be handled.
SHORT SYNTAX:
in = inpoly(p,node);
p : The points to be tested as an Nx2 array [x1 y1; x2 y2; etc].
node: The vertices of the polygon as an Mx2 array [X1 Y1; X2 Y2; etc].
The standard syntax assumes that the vertices are specified in
consecutive order.
in : An Nx1 logical array with IN(i) = TRUE if P(i,:) lies within the
region.
LONG SYNTAX:
[in,on] = inpoly(p,node,edge);
edge: An Mx2 array of polygon edges, specified as connections between
the vertices in NODE: [n1 n2; n3 n4; etc]. The vertices in NODE
do not need to be specified in connsecutive order when using the
extended syntax.
on : An Nx1 logical array with ON(i) = TRUE if P(i,:) lies on a
polygon edge. (A tolerance is used to deal with numerical
precision, so that points within a distance of
eps^0.8*norm(node(:),inf) from a polygon edge are considered "on"
the edge.
EXAMPLE:
polydemo; % Will run a few examples
See also inpolygon
>>帮助inpoly
inpoly:多边形中点测试。
确定一系列点是否在多边形的边界内
在2D平面中。一般非凸,多重连接的多边形
区域可以处理。
简短语法:
in = inpoly(p,node);
p:要测试的点作为Nx2数组[x1 y1; x2 y2;等等]。
节点:作为Mx2数组的多边形的顶点[X1 Y1; X2 Y2;等等]。
标准语法假定在以下位置指定了顶点
连续订单。
in:如果P(i,:)位于N(x)内的Nx1逻辑数组为TRUE
地区。
长语法:
[in,on] = inpoly(p,node,edge);
edge:多边形边的Mx2数组,指定为之间的连接
节点中的顶点:[n1 n2; n3 n4;等等]。 NODE中的顶点
使用时不需要连续指定
扩展语法。
on上:如果P(i,:)位于a上,则ON(i)= TRUE的Nx1逻辑数组
多边形边缘。 (公差用于处理数值
精度,使点在
来自多边形边缘的eps ^ 0.8 * norm(node(:),inf)被视为“开”
边缘。
例:
多义%将运行一些示例
另见inpolygon
本文介绍了一个名为inpoly的算法,用于测试一系列点是否位于2D平面内的多边形边界内,包括非凸和多重连接的多边形区域。文章详细解释了简短语法和长语法的使用方法,并提供了示例。
403

被折叠的 条评论
为什么被折叠?



