Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

voronoi-diagram

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

voronoi-diagram

Constructs a Voronoi diagram for a collection of points

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27
increased by17.39%
Maintainers
1
Weekly downloads
 
Created
Source

voronoi-diagram

Construct a voronoi diagram for a collection of points. Works in any dimension in both node.js and in a web browser

  • 2D Voronoi diagram demo
  • 3D Voronoi diagram demo

testling badge

build status

Example

var voronoi = require("voronoi-diagram")

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

console.log(voronoi(points))

Install

npm install voronoi-diagram

API

require("voronoi-diagram")(points)

Constructs a voronoi diagram for a collection of points.

  • points is an array of points in n-dimensional space

Returns An object with two properties

  • positions an array of points representing the location of the voronoi sites
  • cells an array of indices with the same length as points representing the voronoi sites. -1 indicates a point at infinity. In 2D the cells are oriented clockwise, while in 3D they are sorted lexicographically.

Credits

(c) 2013 Mikola Lysenko. MIT License

Keywords

FAQs

Package last updated on 03 Jun 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc