Voronoi Diagrams

Voronoi diagrams are pretty neat. https://en.wikipedia.org/wiki/Voronoi_diagram

To create a voronoi diagram:

  1. Pick some points in 2d space.
  2. Assign colors to those points.
  3. Create an blank canvas image with enough pixels to represent that 2d space.
  4. Assign every pixel in that image to the color of the closest point.

Step four is interesting because there are lots of ways to measure distance. I wrote a program to create voronoi diagrams using different distance functions. Here are the results:

Euclidean-distance:

Manhattan-distance:

Hacky manhattan-distance with polar coordinates:



Comments