首页 | 本学科首页   官方微博 | 高级检索  
     

线点包容检测算法
引用本文:孙贤斌,尹杰,肖本林,熊才权. 线点包容检测算法[J]. 计算机与现代化, 2008, 0(10): 14-17
作者姓名:孙贤斌  尹杰  肖本林  熊才权
作者单位:1. 湖北工业大学,湖北,武汉,430068;华中科技大学图像识别与人工智能研究所,湖北,武汉,430070
2. 湖北工业大学,湖北,武汉,430068
摘    要:提出的算法是先以快速的方法判断线与多边形是否有交点,如有,则求出线与多边形的各个交点,将交点进行排序,将此线按交点顺序分为多段;如果无交点,则此线只有一段。检测各段中点是否位于多边形内,如果位于内部,则此段在内,否则此段在外。以倾斜射线法检测点的包容性,其特点是此射线不与多边形的顶点或边重合,无须作特殊情况的处理,计算区域小,因而计算量小,对自相交多边形及带孔多边形等多类情况同样适用。通过编写程序计算验证表明,此算法简单有效、稳定可靠,适用于多类情况。

关 键 词:点包容性  线包容性  倾斜射线  交点排序

Algorithm for Point and Line in Polygon Test
SUN Xian-bin,YIN Jie,XIAO Ben-lin,XIONG Cai-quan. Algorithm for Point and Line in Polygon Test[J]. Computer and Modernization, 2008, 0(10): 14-17
Authors:SUN Xian-bin  YIN Jie  XIAO Ben-lin  XIONG Cai-quan
Affiliation:SUN Xian-bin, YIN Jie, XIAO Ben-lin, XIONG Cai-quan ( 1. Hubei University of Technology, Wuhan 430068, China; 2. Institute of Image Recognizing and Artificial Intelligence, Huazhong University of Science and Technology, Wuhan 430070, China)
Abstract:A convenience algorithm for point and line in polygon test,sloping line method is provided,the characteristic of this method is that the sloping line is not match together with any peak or edge of polygon,no special situation is needed processing,the computation is decreased.The prepared algorithm of line in polygon is not perfect,a new algorithm is presented.First,identify whether there are crossing points in line and polygon by a quick method,if there are crossing points,calculate the crossing points of line and polygon,put these points in order,and then make the line into several segments by these crossing points.If there is not crossing point,the line is only one segment.Test the center of every segment in polygon.If its center is in the polygon,then this segment is in the polygon,else,it is not.This algorithm is simple and effective in programming,and it is suitable for most case.
Keywords:point in polygon  line in polygon  sloping line  crossing points sequence
本文献已被 CNKI 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号