>> help inpoly

本文介绍了一个名为inpoly的算法,用于测试一系列点是否位于2D平面内的多边形边界内,包括非凸和多重连接的多边形区域。文章详细解释了简短语法和长语法的使用方法,并提供了示例。

>> 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

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值