Skip to contents

The cell of \(x_i\) is the window intersected with the half-planes \((x_j - x_i) \cdot (u - (x_i + x_j)/2) \le 0\) for every other point, computed by Sutherland-Hodgman clipping. Returned with the cell areas, the Voronoi intensity \(1/area\) at each point (Barr and Schoenberg 2010), perimeters, centroids, the Voronoi edges between points (the Delaunay neighbours) with their lengths, the adjacency matrix, the neighbour counts and the Voronoi entropy \(-\sum_k P_k \log P_k\) of their distribution. Areas and neighbours equal deldir::deldir with digits = 15.

Usage

VoronoiCells(points, window)

Arguments

points

Distinct points (n x 2) inside window.

window

Rectangle c(xmin, xmax, ymin, ymax) or a convex polygon (m x 2 matrix, counter-clockwise).

Value

List with areas, cells, intensity, perimeters, centroids, edges (matrix of 1-based i, j, length), neighbours, adjacency, neighbour_counts, entropy.

References

Okabe, A., Boots, B., Sugihara, K. and Chiu, S. N. (2000). Spatial Tessellations, 2nd ed. Wiley.

Barr, C. D. and Schoenberg, F. P. (2010). On the Voronoi estimator for the intensity of an inhomogeneous planar Poisson process. Biometrika 97, 977-984.

Bormashenko, E. et al. (2018). Characterization of self-assembled 2D patterns with Voronoi entropy. Entropy 20, 956.

Examples

VoronoiCells(rbind(c(0.25, 0.5), c(0.75, 0.5)), c(0, 1, 0, 1))$areas
#> [1] 0.5 0.5