Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
robust-point-in-polygon
Advanced tools
Exactly test if a point is inside, outside or on the boundary of a polygon
Exactly determines if a point is contained in a 2D polygon.
var classifyPoint = require("robust-point-in-polygon")
var polygon = [ [ 1, 1 ], [ 1, 2 ], [ 2, 2 ], [ 2, 1 ] ]
console.log(
classifyPoint(polygon, [1.5, 1.5]),
classifyPoint(polygon, [1, 2]),
classifyPoint(polygom, [100000, 10000]))
Output:
-1 0 1
npm install robust-point-in-polygon
require("robust-point-in-polygon")(loop, point)
Tests if a point is contained in the interior of a simple polygon
loop
is an array of vertices for the polygonpoint
is a 2D point which is classified against the polygonReturns An integer which determines the position of point
relative to polygon
. This has the following interpretation:
-1
if point
is contained inside loop
0
if point
is on the boundary of loop
1
if point
is outside loop
(c) 2014 Mikola Lysenko. MIT License
FAQs
Exactly test if a point is inside, outside or on the boundary of a polygon
The npm package robust-point-in-polygon receives a total of 19,051 weekly downloads. As such, robust-point-in-polygon popularity was classified as popular.
We found that robust-point-in-polygon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.