• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

Computer Engineering & Science

Previous Articles     Next Articles

A  sign(x) point in-out polygon test algorithm
based on sign function and its application

SUN Ai-ling,ZHAO Guang-hua,ZHAO Min-hua,CHANG Lu   

  1. (School of Information and Control Engineering,Xi’an University of Architecture and Technology,Xi’an 710055,China)
  • Received:2015-10-14 Revised:2016-01-31 Online:2017-04-25 Published:2017-04-25

Abstract:

By studying and analyzing a number of existing methods for point in-out polygon tests, we propose a new algorithm for point in-out polygon tests. This algorithm solves the two-dimensional problem in three-dimensional space. We regard the point in the two-dimensional space as a point of the three-dimensional space, hence obtaining simple coordinate relations between the point and the polygon vertices. Since the sign function only has three values, we particularly use the sign function to record the coordinate relation between the point and the polygon vertices. In the end, we can use the sum of sign function to determine whether the point is in the polygon or not. Software implementation verifies the simplicity and efficiency of the proposed algorithm. This algorithm is applied to a field test system of driving license based on the RTK GPS positioning technology, and the results show that the judgment accuracy of point in-out polygon tests is high, and the real-time performance is satisfactory.

Key words: polygon, point, coordinate relations, sign function