
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
polygon-points
Advanced tools
Determine if an x y coordinate exists in a polygon. This is being used in a motion detection project where specific regions of an image are being filtered and measured. It works fast when iterating pixels because it caches the bounding box value and uses it to quickly eliminate non-targeted pixels from unnecessary difference calculations. It is designed to be used with positive integer values starting with an x y value of 0 0 at the top left.
npm install polygon-points --save
const PP = require('polygon-points');
const polygonPoints = new PP([{x: 0, y: 0}, {x: 0, y: 100}, {x: 100, y: 100}, {x: 100, y: 0}]);
//public methods
//check if a point exists in the polygon
polygonPoints.containsPoint(1, 1);//returns true
//get bounding box of polygon
polygonPoints.boundingBox;//returns an array of 4 x y coordinates
//get total number of points that exist in polygon
polygonPoints.pointsLength;//returns 10000
//set vertexes after creating polygonPoints object
polygonPoints.vertexes = [{x: 0, y: 0}, {x: 0, y: 100}, {x: 100, y: 100}, {x: 100, y: 0}];
//get minX, maxX, minY, and maxY unsigned integers of bounding box
polygonPoints.minX, polygonPoints.maxX, polygonPoints.minY, polygonPoints.maxY;
FAQs
Determine if an x y coordinate exists in a polygon.
The npm package polygon-points receives a total of 1,102 weekly downloads. As such, polygon-points popularity was classified as popular.
We found that polygon-points 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.