惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
G
Google Developers Blog
L
LangChain Blog
Y
Y Combinator Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
V
Visual Studio Blog
小众软件
小众软件
月光博客
月光博客
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
The Blog of Author Tim Ferriss
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
美团技术团队
量子位

博客园 - Pharaoh

jae的mongo数据库管理工具(原创) 简单的远程控制软件 学习Python,编写了个网站 - Pharaoh - 博客园 将Unicode字符串转换为普通文字 - Pharaoh - 博客园 测试从Mathon插件发表 VS集成环境中的JavaScript脚本语法检查 测试用Windows Live Writer [转]滚动条颜色生成工具。 用资源管理器打开“打开文件”对话框的目录。 - Pharaoh - 博客园 用Word2007发Blog的配置方法(多图)。 - Pharaoh - 博客园 测试Word2007 用批处理写的显示磁盘剩余空间的小程序。 总算亲自看见了一个网站被黑后的页面。 [转]XP如何禁止媒体文件预览 Google Calendar V2.0汉化 快捷方便的对js文件进行语法检查。 用IronPython作为.Net的脚本语言。 C#通过http访问olap 事开机时Num Lock键打开。
面是否包含点的算法
Pharaoh · 2013-08-07 · via 博客园 - Pharaoh

from arcgis Javascript api:

function polygonContainPoint(pt,polygon) {
    var rings = polygon.rings,
        ring, bresult = false,
        pt1, pt2, ringlength, j, i, indexrings, ringslength = rings.length;
    for (indexrings = 0; indexrings < ringslength; indexrings++) {
        ring = rings[indexrings];
        ringlength = ring.length;
        j = 0;
        for (i = 0; i < ringlength; i++) {
            j++;
            if (j === ringlength) {
                j = 0;
            }
            pt1 = ring[i];
            pt2 = ring[j];
            if ((pt1[1] < pt.y && pt2[1] >= pt.y || pt2[1] < pt.y && pt1[1] >= pt.y) && (pt1[0] + (pt.y - pt1[1]) / (pt2[1] - pt1[1]) * (pt2[0] - pt1[0]) < pt.x)) {
                bresult = !bresult;
            }
        }
    }
    return bresult;
}