Socket
Book a DemoInstallSign in
Socket

monotone-convex-hull-2d

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

monotone-convex-hull-2d

Robust 2D convex hull algorithm

1.0.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

monotone-convex-hull-2d

Computes the convex hull of a set of points in the plane in O(n log(n)) time using the Monotone chain algorithm.

  • Demo Link

Example

var convexHull = require('monotone-convex-hull-2d')

var points = [
  [0, 0],
  [1, 0],
  [0, 1],
  [1, 1],
  [0.5, 0.5]
]

console.log(convexHull(points))

Output:

[ 0, 2, 3, 1 ]

Install

npm install monotone-convex-hull-2d

API

require('monotone-convex-hull-2d')(points)

Construct the convex hull of a set of points.

  • points is an array of points represented as an array of length 2 arrays

Returns The convex hull of the point set represented by a clockwise oriented list of indices.

Credits

(c) 2014 Mikola Lysenko. MIT License

Visualizer (c) 2013 Dan Melanz

Keywords

monotone

FAQs

Package last updated on 14 Oct 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.