Spherical Voronoi Diagram
62 points
4 days ago
| 6 comments
| jasondavies.com
| HN
archontes
1 minute ago
[-]
Now compensate for the oblateness of the Earth.
reply
mkl
16 minutes ago
[-]
For me in Firefox Android, rotating the globe scrolls the page at the same time, so it's pretty hard to use.

SciPy can calculate spherical Voronoi diagrams, and MatPlotLib can display them with map projections. I haven't tried to display them as a rotatable globe, but years ago I did it in 2D for volcanos: https://news.ycombinator.com/item?id=21301942, https://imgur.com/closest-volcano-lsxjRXP (argh, Imgur has gotten really aggressive with autoplaying unrelated videos - at least they're silent).

reply
kayo_20211030
35 minutes ago
[-]
Thanks and very fun. The graphic "The United States of Voronoi" is another reminder of why the mercator projection is so counter-intuitive at times.
reply
zokier
6 minutes ago
[-]
I'm not really seeing the connection to projections here?
reply
hermitcrab
4 hours ago
[-]
I remember seeing something similar to https://www.jasondavies.com/maps/voronoi/capitals/. But the areas were weighted by the populations of the capitals. You ended up with something quite close to real political maps IIRC.
reply
srean
3 hours ago
[-]
The first thing I noticed was the spherical Dodadecahedron and if you turn on Delaunay triangulation button, then it's dual the Icosahedron, my favourite, the relationship is entirely platonic.

It would be fun to do Turtle graphics with geodesic motions on the sphere. If one adds Loxodromic motions, even better.

The geodesic turtle on the globe would be a good way to play with other platonic solids.

reply
wood_spirit
4 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?

reply
orthoxerox
4 hours ago
[-]
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.

reply
srean
3 hours ago
[-]
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).

reply
orthoxerox
3 hours ago
[-]
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

reply
srean
3 hours ago
[-]
Ah! I see. Thanks for the reference.
reply
srean
4 hours ago
[-]
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.

reply
red_trumpet
57 minutes ago
[-]
> This implementation uses a randomised incremental algorithm to compute the 3D convex hull of the spherical points.

This makes me think he uses the Euclidean geometry of the surrounding three-dimensional space. But of course spherical geometry is induced by the surrounding Euclidean geometry, so the results are the same as using spherical geometry directly.

reply
wood_spirit
3 hours ago
[-]
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

reply