Git Product home page Git Product logo

voronoi-diagram's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

voronoi-diagram's Issues

Problem with small amount of point (colinearity?)

Hi!
I have tried a simple example with both voronoi-diagram and d3-voronoi packages with a small amount of point.
Results are different and while in d3-voronoi I'm getting what I'm expecting with voronoi-diagram I am not. I've put both codes in a small repository here: https://github.com/nkint/voronoi-test
Talking about it in slack someone point out about a colinearity issue.
Is this a known issue?

Error in example code

The current example has:

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

This results in the output:
{ cells: [ [ undefined, undefined, undefined, undefined ] ],
points: [] }

If the outer brackets are removed, the output becomes:
{ cells: [ [ -1, 0 ], [ -1, 0 ], [ 0, -1 ] ],
points: [ [ 0.5, 0.5 ] ] }

I suspect this is the intended functionality.

Provide example for higher dimensional input

e.g. 3-dimensional points.

I tried running this:

var points3d = [[1,0,1],[0,1,2],[0,0,1.4],[3,2,1]];
voronoi(points3d)

but just got weird results:

{ cells: 
   [ [ undefined,
       undefined,
       undefined,
       undefined,
       undefined,
       undefined,
       undefined,
       undefined,
       undefined,
       undefined ],
     [ undefined,
       undefined,
       undefined,
       undefined,
       undefined,
       undefined,
       undefined,
       undefined ],
     [ undefined,
       undefined,
       undefined,
       undefined,
       undefined,
       undefined,
       undefined,
       undefined,
       undefined,
       undefined ],
     [ undefined,
       undefined,
       undefined,
       undefined,
       undefined,
       undefined,
       undefined,
       undefined ] ],
  points: [ [ -2.900000000000034, 5.900000000000027, -7.300000000000026 ] ] }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.