Socket
Book a DemoInstallSign in
Socket

weighted-delaunay

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

weighted-delaunay

Weighted Delaunay triangulation in any dimension

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

weighted-delaunay

Constructs the weighted Delaunay triangulation of a set of points. This is equivalent to constructing a Delaunay triangulation of a set of spheres whose radii are the same as the weights for each point.

Demo

Example

var wdt = require('weighted-delaunay')

var points  = new Array(10)
var weights = new Array(10)
for(var i=0; i<10; ++i) {
  points[i] = [ Math.random(), Math.random() ]
  weights[i] = Math.random()
}

var cells = wdt(points, weights)

console.log(cells)

Output

Example output:

[ [ 1, 0, 5 ],
  [ 1, 4, 6 ],
  [ 0, 7, 5 ],
  [ 1, 7, 4 ],
  [ 7, 1, 5 ],
  [ 7, 0, 8 ] ]

Install

npm i weighted-delaunay

API

require('weighted-delaunay')(points, cells[, pointAtInfinity])

Constructs a weighted Delaunay triangulation.

  • points - the points of the weighted delaunay triangulation
  • weights the weights for each points
  • pointAtInfinity an optional flag, which if set to true adds the point at infinity to the triangulation. (Default false)

Returns The cells of the resulting weighted Delaunay triangulation.

License

(c) 2015 Mikola Lysenko. MIT License

Keywords

tape

FAQs

Package last updated on 03 Jul 2015

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