Coder Social home page Coder Social logo

isaacguan / voronoi-delaunay Goto Github PK

View Code? Open in Web Editor NEW
29.0 3.0 4.0 1.78 MB

An implementation of Voronoi diagram and Delaunay triangulation

License: GNU General Public License v3.0

C# 100.00%
voronoi-diagram delaunay-triangulation computational-geometry

voronoi-delaunay's Introduction

Voronoi-Delaunay

This is an implementation and visualization of Voronoi diagram and Delaunay triangulation in C#.

In this implementation, Voronoi diagram is obtained from generating its dual, Delaunay triangulation, which is derived in a very simple manner, the Bowyer-Watson algorithm. The most naïve implementation of Bowyer-Watson algorithm takes O(n^2) time. With the help of the JavaScript implementation of @ironwallaby, the time complexity is reduced by sorting the points by x-coordinate and using an open list and a closed list to store Delaunay triangles in each insertion of point.

For constructing Voronoi diagram, a data structure is used of storing each point with a triangle list containing all the triangles incident on it. Thus, by traversing the triangle lists of the two end points, we can directly find the two adjacent triangles of a certain Delaunay edge and connect the centers of their circumcircles. As Delaunay triangulation is a planar graph, the procedure of finding adjacent triangles takes constant time and the total time of generating Voronoi diagram is O(n).

In addition, another version of this implementation can be found in the animation branch of this repository that shows the Bowyer-Watson algorithm in steps. You could visit my blog for more specifics of the implementation.

voronoi-delaunay

voronoi-delaunay's People

Contributors

isaacguan avatar

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

Watchers

 avatar  avatar  avatar

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.