wuga214 / TOOLBOX_Voronoi_Diagram_JAVA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VoronoiDiagram

This code is an JAVA implementation of Fortune's Algorithm to compute voronoi diagram 2D.

Demo:

demo

Features:

This code can output voronoi edges as ArrayList. each edges has built in functions that allows:

  1. get points that share this edge.
  2. get direction of this edge.

There is an function to compute polygon for each input point.

![alt tag](https://github.com/wuga214/VoronoiDiagram/blob/master/code/figure.png)

How to use:

Please see example in src/Main.java

Glitch:

This code has a glitch that can cause voronoi graph draw some unreasonable lines for data points that share similary y-axis values.
But for small data set (less than 1000 points), it is very unlikely happen.
If you can fix it, please contact me.

About Fortune's Algorithm:

Tutorial Slides here
Someone's Blog here

About

License:MIT License


Languages

Language:Java 100.0%