Skip to content

Instantly share code, notes, and snippets.

View serenity4's full-sized avatar

Cédric Belmant serenity4

View GitHub Profile
@serenity4
serenity4 / voronoi_stats.jl
Created November 9, 2020 18:36
Statistics for the number of k-faces of a Voronoi triangulation
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)