检查一个点是否存在于包含4个顶点的给定区域中 [英] check if a point exists in given area containing 4 vertices

查看:107
本文介绍了检查一个点是否存在于包含4个顶点的给定区域中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://www.weather.gov/directives/sym/pd01008006curr .pdf ,第8页,我们给出了一个在地理坐标系(lat和long系统)中有四个顶点的区域。我想检查一个特定纬度和长度的点是否存在于该区域内。

refering to http://www.weather.gov/directives/sym/pd01008006curr.pdf, page 8, we are given an area with four vertices in geographic coordinate system(lat and long system). I want to check if a point with particular lat and long exists within that area.

推荐答案

点在任意多边形内(任意数量的边,凹面也允许)是选择一个你知道在多边形之外的点;如果您正在测试的点与多边形之外的点之间的线段与多边形线段的ODD数字相交,则该点位于多边形内。

The way to test whether or not a point is within an arbitrary polygon (any number of sides, concave allowed as well) is to choose a point that you know is OUTSIDE the polygon; if a line segment between the point you are testing and the point that is outside the polygon crosses an ODD number of the polygon segments, the point is within the polygon.

这篇关于检查一个点是否存在于包含4个顶点的给定区域中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆