\

Spherical Voronoi Diagram

115 points - last Wednesday at 3:32 PM

Source
  • mkl

    today at 1:54 PM

    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).

    • hermitcrab

      today at 9:57 AM

      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.

        • loremium

          today at 4:00 PM

          β€œYou don’t choose anything. You’re born into it, man. One side or the other. You play it out.” Miller (the expanse)

      • kayo_20211030

        today at 1:35 PM

        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.

          • srean

            today at 2:17 PM

            The problem that Mercator was trying to solve and the solution he came up with is super interesting to me. Very neat.

            It is still not known for sure how he came up with mathematical details of the stretching and spacing of the latitudes.

            The actual closed form was discovered much later and that too by sheer accident - by looking at log trig tables and noticing they match the Mercator scaling numerically, upto four places of decimals, not by working out the integral from first principles. Once the connection has been made it was formally derived of course.

            100 years to solve an integral The history of the Mercator map and the integral of the secant https://liorsinai.github.io/mathematics/2020/08/27/secant-me...

            https://news.ycombinator.com/item?id=24304311

            https://news.ycombinator.com/item?id=43741273

            Also, many find it very unintuitive that even in the absence of waves, winds, currents or such disturbances, you will have to constantly steer to follow constant bearing paths (North-South and equatorial East-West excluded). You have to steer even if you want to follow a latitude East-West, barring the Equator.

            Its not that you can set your heading South by Southwest and be done with it, even if there are no disturbances.

              • ghurtado

                today at 6:06 PM

                > you will have to constantly steer to follow constant bearing paths

                Is this why airline routes look like they are "hopping" on a map?

                When I was a kid, I thought this was meant to represent the Z axis (so until today)

            • WillAdams

              today at 2:15 PM

              The Mercator projection is perfectly suited to its intended use --- maintaining angles for navigation.

              That it was pushed into other usages was a function of cold war politics (makes Russia seem larger/more intimidating) and needs to be considered in that context.

              Arguably, every classroom (and home with children) should have a globe.

                • stephbook

                  today at 4:46 PM

                  The Mercator hate is a remnant of the turn of the decade. The unprivileged "global south" is smaller than Greenland!!

                  Except that Google Maps (yes maps, not Google Earth) has shown a globe for a decade now.

                  And, of course, pupils do have access to a globe. But somehow, people always frame it as an unfulfilled necessity that perpetuates "global power imbalances" or stuff like that.

                  • srean

                    today at 2:22 PM

                    > Arguably, every classroom (and home with children) should have a globe

                    Or even better is to build one. It is a lot of fun.

                    It is very instructive to understand why you need to shape the gores that you cut out of flat paper to stick them to the sphere. The boundaries of the gores need to curve so that there are no creases or no bits and pieces sticking out. Even then it is not going to be an exact fit on the globe, unless the flat material has some give.

                    One needs some interrupted equi-areal projection.

                    Interrupted sinusoidal is the one commonly used

                    https://www.jasondavies.com/maps/interrupted-sinusoidal/ (from the same site). Imagine running zipper fastners along the tears/boundaries. When one zips up one almost forms an exact sphere.

                    https://en.wikipedia.org/wiki/Sinusoidal_projection

                    • Analemma_

                      today at 2:24 PM

                      > That it was pushed into other usages was a function of cold war politics (makes Russia seem larger/more intimidating) and needs to be considered in that context.

                      Is this actually true, or was it just done "on autopilot" because before universal public education most people using maps of the entire world were navigators for whom Mercator made the most sense?

                      I don't know, I just hear a lot of conspiracy theories about the dominance of Mercator. If it's not Cold War politics then it's "white supremacists trying to make North America/Europe larger and Africa smaller", and I think laziness and just going with what worked in the past is a more likely explanation.

                        • today at 2:28 PM

                  • zokier

                    today at 2:04 PM

                    I'm not really seeing the connection to projections here?

                      • kayo_20211030

                        today at 2:20 PM

                        I reckon that OP did the work and that the map is correct. The CA/NV border seems weird. Under Mercator, you're insisting that the angles are correct in the projection. It just looks a little strange - with all those straight lines that you'd expect to see on a plane, but not on a sphere. The conservation of angles threw me off.

                • markstos

                  today at 3:13 PM

                  Voroni is useful for spatial analysis when you want to assign points to a nearest /something/ like airplane positions to the nearest airport.

                  I used for intersection crash analysis to make sure each crash was assigned to at most intersection. I combined this with a radius around each intersection so crashes too far away were also not attributed to an intersection.

                  More here: https://mark.stosberg.com/intersection-crash-analysis-with-q...

                  • srean

                    today at 10:16 AM

                    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.

                    • zokier

                      today at 2:14 PM

                      Reminds me of this little map I created some time ago: https://ibb.co/TPVMCR3

                      My intent was to simplify the shapes of state borders as much as possible while retaining the topological (?) relationship between states. But there is no fancy math behind my map, it's just hand-drawn mess.

                        • ghurtado

                          today at 6:03 PM

                          Very "60s movie cartoon credits". I absolutely love it.

                          (I guess saying "The Incredibles" would have been shorter, but it feels weird to credit them with this style)

                          • trial3

                            today at 2:46 PM

                            i’m amused by Triangle New York

                        • wood_spirit

                          today at 9:44 AM

                          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?

                            • orthoxerox

                              today at 9:50 AM

                              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.

                                • srean

                                  today at 10:22 AM

                                  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).

                            • srean

                              today at 10:10 AM

                              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.

                                • red_trumpet

                                  today at 1:14 PM

                                  > 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.

                                  • wood_spirit

                                    today at 11:03 AM

                                    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

                            • archontes

                              today at 2:09 PM

                              Now compensate for the oblateness of the Earth.