摘要: // 功能:判断点是否在多边形内// 方法:求解通过该点的水平线与多边形各边的交点// 结论:单边交点为奇数,成立!//参数:// POINT p 指定的某个点// LPPOINT ptPolygon 多边形的各个顶点坐标(首末点可以不一致)// int nCount 多边形定点的个数BOOL PtInPolygon (POINT p, LPPOINT ptPolygon, int nCount){int nCross = 0;for (int i = 0; i < nCount; i++) { POINT p1 = ptPolygon[i]; POINT p2 = ptPolygon[ 阅读全文
posted @ 2011-04-23 19:09 fenix 阅读(616) 评论(0) 推荐(0) 编辑