Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find Voronoi cell and neighbors #51

Closed
igagen opened this issue Nov 4, 2018 · 4 comments
Closed

Find Voronoi cell and neighbors #51

igagen opened this issue Nov 4, 2018 · 4 comments

Comments

@igagen
Copy link

igagen commented Nov 4, 2018

Is there a way to find the voronoi cell covering a point? And once you have a cell, is there a way of getting all the neighboring cells?

@igagen igagen changed the title Find voronoi cell and neighbors Find Voronoi cell and neighbors Nov 4, 2018
@igagen igagen closed this as completed Nov 4, 2018
@igagen igagen reopened this Nov 4, 2018
@mbostock
Copy link
Member

mbostock commented Nov 4, 2018

@mbostock mbostock closed this as completed Nov 4, 2018
@igagen
Copy link
Author

igagen commented Nov 5, 2018

I’m asking about the Voronoi cell and it’s neighbors, not the Delaunay triangle at a point. Is there a simple way to go from Delaunay triangle and neighbors to Voronoi?

@mbostock
Copy link
Member

mbostock commented Nov 5, 2018

The Voronoi is the dual of the Delaunay, so the tasks are equivalent.

So, the closest point to a given location [x, y] returned by delaunay.find is the Voronoi cell that contains that point.

And given a point i, delaunay.neighbors returns the connected points on the Delaunay triangulation, which are also the adjacent Voronoi cells.

@igagen
Copy link
Author

igagen commented Nov 5, 2018

Got it, I wasn’t sure if the Voronoi indices matched the Delaunay indices. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants