
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
polygon-intersect-test
Advanced tools
determine whether two polygons intersect in 2d
This package works on both nested and flat arrays (good for typed arrays) and you can provide array offsets to avoid instantiation overhead for subarray slices.
var polygonIntersect = require('polygon-intersect-test')
var A = [
-1.00,-1.00, -1.00,+1.00, +1.00,+1.00, +1.00,-1.00, -1.00,-1.00,
-1.00,-1.01, +1.01,-1.01, +1.01,+1.01, -1.01,+1.01, -1.01,-1.00
]
var B = [ -0.50,+0.10, -0.80,-0.20, -0.40,+0.00, ]
var C = [ -0.90,+0.80, -1.05,-0.60, -0.75,+0.70 ]
console.log(polygonIntersect(A,B)) // false
console.log(polygonIntersect(A,C)) // true
var polygonIntersectTest = require('polygon-intersect-test')
var polygonIntersectTestFlat = require('polygon-intersect-test/flat')
var polygonIntersectTestNested = require('polygon-intersect-test/nested')
Return a boolean of whether the polygons A and B intersect.
A and B may both be flat arrays or they may both be nested arrays of 2-item [x,y] arrays.
Optionally provide arange or brange as 2-item arrays of [start,end] array index offsets into
the respective A or B polygon.
You may also use the dedicated flat (polygonIntersectTestFlat) or nested
(polygonIntersectTestNested) routines to skip a check to find the appropriate implementation.
npm install polygon-intersection-test
bsd
FAQs
determine whether two polygons intersect in 2d
The npm package polygon-intersect-test receives a total of 132 weekly downloads. As such, polygon-intersect-test popularity was classified as not popular.
We found that polygon-intersect-test 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.