
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.
rectangles-intersect
Advanced tools
Determine if two rectangles intersect each other.
npm install rectangles-intersect
var intersects = require('rectangles-intersect');
inersects(rect1,rect2 [,precision]);
rect1 and rect2 are rectangles, array of corner points. Whereas point is array of x and y coordinate.
precision after decimal places, default is 6
var intersects = require('rectangles-intersect');
var check = intersects(
[[0,10], [10,0], [20,10], [10,20]],
[[10,10], [20,0], [30,10], [20,20]]);
if (check) {
console.log('two rectangles intersect');
}
```
## note
In this module my approach is:
check 1: intersection of any edge of rectangle with another rectangle's edges
check 2: any corner point of rectangle is inside another rectangle
If check 1 or check 2 satisfies then rectangles intersect otherwise not.
This approach is not quite efficient. For improving efficiency get the implementation of [Separating Axis Theorem](http://gamedevelopment.tutsplus.com/tutorials/collision-detection-using-the-separating-axis-theorem--gamedev-169), read more at [wiki](https://en.wikipedia.org/wiki/Hyperplane_separation_theorem)
## developing
Once you run
```npm isntall```
then for running test
```npm run test```
to create build
```npm run build```
## License
This project is licensed under the terms of the MIT license.
FAQs
Determine if two rectangles intersect each other.
The npm package rectangles-intersect receives a total of 10 weekly downloads. As such, rectangles-intersect popularity was classified as not popular.
We found that rectangles-intersect 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.