Skip to content

Instantly share code, notes, and snippets.

@serenity4
serenity4 / voronoi_stats.jl
Created Nov 9, 2020
Statistics for the number of k-faces of a Voronoi triangulation
View voronoi_stats.jl
using Plots
"""
Lower and upper bounds on the number of `k`-faces for a Voronoi diagram in `d`-dimensional space using `n` points.
"""
function n_faces_voronoi(k, d, n; return_mean=true)
vals = if k == 0
r = div(d + mod(d, 2), 2)
if mod(d, 2) == 0
n^r/factorial(r), 2 * n^r/factorial(r)