Given a collection of \(N\) points \(\textbf x_1,\textbf x_2,…,\textbf x_N\in\textbf R^2\) in the Cartesian plane \(\textbf R^2\), one can enclose each such point \(\textbf x_i\) in a Voronoi cell consisting of the set of all points \(\textbf x\in\textbf R^2\) in the plane for which \(|\textbf x-\textbf x_i|\leq |\textbf x-\textbf x_j|\) for all \(j=1,2,…,N\). These Voronoi cells thereby form a partition of the plane \(\textbf R^2\) into \(N\) disjoint subsets. In crystallography, the analog of these Voronoi cells are called Wigner-Seitz cells, and of fundamental importance is the Wigner-Seitz cell of the reciprocal lattice \(\Lambda^*\) because this encodes the first Brillouin zone of a crystal. Using the free plan of the hosting service PythonAnywhere, I setup a Flask application running in the cloud which allows the user to input an arbitrary number \(N\) of points in the Cartesian plane \(\textbf R^2\) and the applet will output a corresponding Voronoi diagram for those points which one can download to one’s local machine. In any case, I have also embedded it here as an interactive frame (iframe) html snippet:
An interesting feature of this construction is that one can play around with what the norm \(|\textbf x|\) means, for instance not enforcing it to be the usual Euclidean \(\ell^2\) norm but perhaps some other \(\ell^p\) norm for \(p\neq 2\). In the future, I would like to also include some functionality for allowing one to choose what \(p\) is and even to animate the dynamics of the Voronoi diagram as \(p\in\textbf R\) varies continuously. Finally, at some point I also hope to generate three-dimensional Voronoi cells (and make them realistic-looking via ray-tracing techniques) or even the stereographic projection of four-dimensional Voronoi cells.