Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
convex-hull
Advanced tools
This module is a wrapper over various convex hull modules which exposes a simple interface for computing convex hulls of point sets in any dimension.
var ch = require('convex-hull')
var points = [
[0,0],
[1,0],
[0,1],
[0.15,0.15],
[0.5, 0.5]
]
//Picture:
//
// [0,1] *
// |\
// | \
// | \
// | \
// | \
// | \
// | \
// | * [0.5,0.5]
// | \
// | \
// | \
// | \
// | \
// | * \
// | [0.15,0.15] \
// [0,0] *---------------* [1,0]
//
console.log(ch(points))
Output:
[[0, 1], [1, 2], [2, 0]]
npm install convex-hull
If you want to use it in a webpage, use browserify.
require('convex-hull')(points)
Computes the convex hull of points
points
is an array of points encoded as d
length arraysReturns A polytope encoding the convex hull of the point set.
Time complexity The procedure takes O(n^floor(d/2) + n log(n)) time.
Note This module is a wrapper over incremental-convex-hull and monotone-convex-hull for convenience. It will select an optimal algorithm for whichever dimension is appropriate.
(c) 2014 Mikola Lysenko. MIT License
FAQs
Any dimensional convex hull
The npm package convex-hull receives a total of 40,658 weekly downloads. As such, convex-hull popularity was classified as popular.
We found that convex-hull 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.