point-in-polygon

determine if a point is inside a polygon

  • 所有者: substack/point-in-polygon
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

point-in-polygon

Determine if a point is inside of a polygon.

This module casts a ray from the inquiry point and counts intersections,
based on
this algorithm.

example

var inside = require('point-in-polygon');
var polygon = [ [ 1, 1 ], [ 1, 2 ], [ 2, 2 ], [ 2, 1 ] ];

console.dir([
    inside([ 1.5, 1.5 ], polygon),
    inside([ 4.9, 1.2 ], polygon),
    inside([ 1.8, 1.1 ], polygon)
]);

output:

[ true, false, true ]

methods

var inside = require('point-in-polygon')

inside(point, polygon)

Return whether point is contained in polygon.

point should be a 2-item array of coordinates.

polygon should be an array of 2-item arrays of coordinates.

install

npm install point-in-polygon

license

MIT

主要指标

概览
名称与所有者substack/point-in-polygon
主编程语言JavaScript
编程语言JavaScript (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2012-01-01 20:23:49
推送于2021-03-16 00:05:36
最后一次提交2021-03-15 14:05:24
发布数4
最新版本名称1.1.0 (发布于 2021-03-15 14:05:24)
第一版名称1.0.0 (发布于 2015-06-13 10:57:10)
用户参与
星数895
关注者数25
派生数100
提交数18
已启用问题?
问题数16
打开的问题数1
拉请求数3
打开的拉请求数0
关闭的拉请求数2
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?