user_guide:tutorials:latest:voronoi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

user_guide:tutorials:latest:voronoi [2020/01/22 09:02] (current)
Line 1: Line 1:
 +====== Voronoi Diagrams ======
 +
 +Voronoi diagrams are constructed from their sites (given in homogeneous coordinates).
 +
 +<code perl>
 +> $VD = new VoronoiPolyhedron(SITES=>​[[1,​1,​1],​[1,​0,​1],​[1,​-1,​1],​[1,​1,​-1],​[1,​0,​-1],​[1,​-1,​-1]]);​
 +> $VD->​VISUAL_VORONOI;​
 +</​code>​
 +Actually, via lifting to the standard paraboloid, Voronoi diagrams are derived from ''​Polytope''​. That's why they have ''​VERTICES'',​ ''​FACETS'',​ and such.
 +
 +<code perl>
 +> print $VD->​FACETS;​
 +2 -2 -2 1
 +1 0 -2 1
 +2 2 -2 1
 +2 -2 2 1
 +1 0 2 1
 +2 2 2 1
 +1 0 0 0
 +> print $VD->​VERTICES;​
 +0 0 1 2
 +0 1 0 2
 +1 1/2 0 -1
 +0 -1 0 2
 +0 0 -1 2
 +1 -1/2 0 -1
 +</​code>​
 +
  
  • user_guide/tutorials/latest/voronoi.txt
  • Last modified: 2020/01/22 09:02
  • (external edit)