Comment by wood_spirit
3 hours ago
Beautiful :)
The idea that springs to my mind is to do Delaunay and Voronoi using spherical geometry. I think the article uses flat Euclidean geometry but if we tweak the fifth axiom we could do spherical or hyperbolic?
Curious about why you think he is using Euclidean.
From the looks of it the separators seem to be segments of great circles. That is what you would get as loci of angular bisectors.
Angular bisectors is what you would get when you use spherical geometry / arc length metric / Haversine metric.
You could still be right though. Euclidean would get you straight line bisectors, but when you project them back to the surface of the sphere, you get great circles again.
This connects with an important point (no pun intended):
People often use Haversine distance to find nearest neighbours on the globe. As long as you want to compute them modulo a hemisphere, this is unnecessary. Haversine distance and Euclidean restricted to the sphere are monotonic transforms of each other. Therefore the nearest point will be the same regardless of which one you used.
As soon as I saw the beautiful rendering I wondered if it was using spherical geometry so I asked an AI. It dug and found discussion on d3 from the author about the algorithm :)
https://github.com/d3/d3/issues/1820
There's an algorithm that does it. I wrote a hobby implementation ten years ago. Basically, it's a modification of the sweeping line algorithm that sweeps the sphere from pole to pole.
edit: Found the code. Looks like I instead ended up simply building a convex hull (which is the Delaunay triangulation) and deriving the Voronoi diagram from it.
For spherical geometry you should not need to do anything special, no ?
Compute the Voronoi tessellation as usual and then project the linear separators back to the sphere (by connecting points on it to centre and extending the ray to the spherical surface).
Yeah, but that's basically projecting 3D geometry back onto the sphere (which is also what I ultimately did). There's a faster algorithm that does it "on the sphere", which I thought I used, but turns out I was wrong.
I think it was this one: https://www.math.kent.edu/~zheng/papers/voronoi_paper_update... or this one http://nautilus.fc.ul.pt/jd/jd10sphere.pdf
1 reply →