变量名 | 类 型 | 静态 | 数组 | 备 注 | pt | Point | | | _poly | Point | | 0 | temp | Point | | 5 | i | 整数型 | | |
pt.x = 34.32812720563 pt.y = 108.9311599731 temp [1 ].x = 1.1 temp [1 ].y = 1.1 temp [2 ].x = 3 temp [2 ].y = 1 temp [3 ].x = 6 temp [3 ].y = 4 temp [4 ].x = 2 temp [4 ].y = 10 temp [5 ].x = 1.1 temp [5 ].y = 1.1 计次循环首 (取数组成员数 (temp ), i ) 加入成员 (_poly, temp [i ]) 计次循环尾 ()输出调试文本 (PointInPoly (pt, _poly )) 返回 (0 ) |
PointInPoly | 逻辑型 | | |
pt | Point | | | | poly | Point | | | |
变量名 | 类 型 | 静态 | 数组 | 备 注 | c | 逻辑型 | | | i | 整数型 | | | l | 整数型 | | | j | 整数型 | | |
c = 假 i = 0 l = 取数组成员数 (poly )j = l - 1 判断循环首 (真) i = i + 1  如果真 (取反 (i < l ))  跳出循环 ()   如果真 (poly [i ].y ≤ pt.y 且 pt.y < poly [j ].y 或 poly [j ].y ≤ pt.y 且 pt.y < poly [i ].y )  如果真 (pt.x (poly [j ].x - poly [i ].x ) (pt.y - poly [i ].y ) ÷ (poly [j ].y - poly [i ].y ) + poly [i ].x )   c = 取反 (c )      j = i 判断循环尾 ()返回 (c )
|