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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?