Snyder's equal-area projection

General discussion of map projections.
brsr
Posts: 11
Joined: Sat May 22, 2021 5:25 pm

Snyder's equal-area projection

Post by brsr »

New blog post, showing that the Collignon projection and the COBE Sky Cube projection are special cases of Snyder's equal-area projection:
https://brsr.github.io/2021/08/31/snyde ... -area.html . Also gives a closed-form formula for the inverse.

Also the paper I mentioned in the Experimental Projections thread was accepted, so that's good news!

-brsr
Milo
Posts: 271
Joined: Fri Jan 22, 2021 11:11 am

Re: Snyder's equal-area projection

Post by Milo »

Nice. It's been very hard to find information on polyhedral projections in general. (Except for the gnomonic, that one's trivial.)

I think the concept of polyhedral projections is cool, but I definitely think it should be possible to do better. I mean, take a look at this graticule. Is that thing even smooth? I think a reasonable minimum requirement of any polyhedral projection should be that it's continuously-differentiable everywhere except the vertices. (The gnomonic fails this, because it's also nondifferentiable at the edges, but the gnomonic projection has never been setting standards of quality - and at least it's still differentiable in the interiors of faces, while the linked image appears to fail even that!)

Of course, as we know, determining a "best" projection is anything but easy.

Just performing a side-by-side comparison, the van Leeuwen projection shown here already looks much better than the Snyder one. But it still has some suspicious points, though I can't tell if they're actually smooth or not. And this distortion chart looks conspiciously wacky, making me feel that there just has to be something cleaner out there.

I'm also aware of the Gringorten projection (yes, a dihedron is also a polyhedron!), but since it's a different polyhedron, it's hard to compare it.

Conformal projections are theoretically simple by comparison. By the Riemann mapping theorem, there only exists one possible conformal map on any given polyhedron (terms and conditions apply), so it's automatically the best. Though, I've still failed find to find any general-case formulae for that projection on the web, except that I know it involves some pretty hard-to-calculate functions.
brsr
Posts: 11
Joined: Sat May 22, 2021 5:25 pm

Re: Snyder's equal-area projection

Post by brsr »

Milo wrote: Wed Sep 01, 2021 2:32 am I think a reasonable minimum requirement of any polyhedral projection should be that it's continuously-differentiable everywhere except the vertices.
Are there any examples of such a projection other than the conformal ones?
Conformal projections are theoretically simple by comparison. By the Riemann mapping theorem, there only exists one possible conformal map on any given polyhedron (terms and conditions apply), so it's automatically the best. Though, I've still failed find to find any general-case formulae for that projection on the web, except that I know it involves some pretty hard-to-calculate functions.
I've poked around a little with discrete analytic functions for mapping the sphere to the plane. Basically, with corresponding circle packings on the sphere and on the plane, you can use functions mapping each circle (and each interstice between three circles) to each other to approximate a conformal map. Chapter 1 of Ken Stephenson's Introduction to Circle Packing is a fairly accessible intro on the topic. It's a numerical approximation, but most polyhedral conformal projections that I'm aware of involve some obscure special function that has to be numerically solved or inverted or whatnot, so it's an even trade.

-brsr
Milo
Posts: 271
Joined: Fri Jan 22, 2021 11:11 am

Re: Snyder's equal-area projection

Post by Milo »

brsr wrote: Wed Sep 01, 2021 5:18 pmAre there any examples of such a projection other than the conformal ones?
Maybe?

It's hard to say for sure without performing complex differential math on formulae that can be hard to come by, but some projections I have pictures of look like they at least come close. Closer than the Snyder projection, anyway.

I'm pretty sure an equal-area projection with this property should be possible, even if it hasn't been discovered yet. The equal-area condition is pretty lax (in the sense that it's easier to satisfy than conformality), and avoiding singularities by smearing them out over a larger area doesn't feel like much to ask for.
brsr wrote: Wed Sep 01, 2021 5:18 pmIt's a numerical approximation, but most polyhedral conformal projections that I'm aware of involve some obscure special function that has to be numerically solved or inverted or whatnot, so it's an even trade.
The thing with numerical approximations is that you want to do as few of them as possible. Both for reasons of speed (brute-force techniques tend to be a lot slower than straightforward formulas) and accuracy (rounding errors accumulate with each successive operation you perform).

Your Wikipedia link seems to agree, noting that "practical applications of this method have been hindered by the difficulty of computing circle packings and by its relatively slow convergence rate".

I'm okay with trying to figure out how to use special functions, so long as I know which special functions, and I don't need to stack too many of them in a row.

The Schwarz triangle function is in theory sufficient to map any spherical or Euclidean (or hyperbolic) polygon onto any other spherical or Euclidean (or hyperbolic) polygon, but I can barely understand one iteration of it, nevermind the nested do-and-undo you'd need to project onto anything other than the upper half-plane (when does anyone want to project things onto the upper half-plane?). Hypergeometric functions aren't something I've ever worked with, but they seem to at least be relatively well-supported by existing libraries (Wikipedia says they can be computed pretty quickly if you know what you're doing).
brsr
Posts: 11
Joined: Sat May 22, 2021 5:25 pm

Re: Snyder's equal-area projection

Post by brsr »

Milo wrote: Wed Sep 01, 2021 6:46 pm I'm okay with trying to figure out how to use special functions, so long as I know which special functions, and I don't need to stack too many of them in a row.

The Schwarz triangle function is in theory sufficient to map any spherical or Euclidean (or hyperbolic) polygon onto any other spherical or Euclidean (or hyperbolic) polygon, but I can barely understand one iteration of it, nevermind the nested do-and-undo you'd need to project onto anything other than the upper half-plane (when does anyone want to project things onto the upper half-plane?). Hypergeometric functions aren't something I've ever worked with, but they seem to at least be relatively well-supported by existing libraries (Wikipedia says they can be computed pretty quickly if you know what you're doing).
We seem to be covering the same ground: I tried the same thing with Schwarz triangle functions. One issue I ran into is this bug in Scipy's implementation of the hypergeometric function (featuring: me whining about how it hasn't been fixed yet), although that can be avoided using symmetry for a regular triangle. The other was that numerically inverting a Schwarz triangle function was a bear. It kept getting tripped up on the branch cuts of the functions. (The inverse of the ratio of two hypergeometric functions is not holonomic.) I got it to work, but it was really slow. Granted I was using the built-in numerical solvers in Numpy, and that could definitely be improved on.

I did recently get ahold of L. P. Lee's monograph "Conformal Projections Based on Elliptic Functions," although I haven't made any headway into it yet. Apparently the Dixon elliptic functions are useful for conformal mapping of triangles. Here's a page on some projections using it from quadibloc.

-brsr
Milo
Posts: 271
Joined: Fri Jan 22, 2021 11:11 am

Re: Snyder's equal-area projection

Post by Milo »

Are there any shapes that are easy to project?

Well, obviously there are a couple. It's very easy to project a circle on the sphere onto a circle on the plane, using azimuthal projections, and these satisfy various criteria of optimality. Digons are also easy to project, either onto a rectangle using cylindrical projections, or onto a circle using the projections that I pioneered here (equal-area) or here (conformal), although those do not satisfy the same criteria of optimality unless the "digon" is just the meridian-interrupted sphere. Indeed, the entire class of pseudocylindrical and lenticular projections is designed to project the meridian-interrupted sphere well, and projections of smaller digons can be easily obtained by cutting them along the meridians, even if this doesn't necessarily produce worthwhile projections.

But aside from those? Are there any other types of shapes that just happen to have convenient, easy-to-calculate projections?

...Okay, I guess I need to be more specific. Any shape can be "projected" by just cutting it out of a larger projection. So I need to either define the desired destination shape (like with polyhedral projections, where you want to project a polygon on the sphere onto the corresponding polygon on the plane, with straight-line edges), or the criterion of optimality I want to use (like how the Lagrange and Eisenlohr are optimal conformal projections of the meridian-interrupted sphere by different metrics). Like, for example, this one.
brsr
Posts: 11
Joined: Sat May 22, 2021 5:25 pm

Re: Snyder's equal-area projection

Post by brsr »

Milo wrote: Sat Sep 04, 2021 9:01 am Are there any shapes that are easy to project?
All of the hemisphere-to-polygon conformal maps can be expressed like this:
  • Sterographic projection from hemisphere to disk
  • Mobius transformation from disk to upper half-plane
  • Schwarz–Christoffel mapping from upper half-plane to polygon
When the polygon is a square, it's the Adams/Guyou/Peirce projection, and the Schwarz-Christoffel mapping reduces to an elliptic integral, which has an inverse in terms of Jacobi elliptic functions. I think you can get a conformal projection to a rectangle by changing the parameters of the elliptic integral.

For a triangle, it's a hypergeometric function. A single hypergeometric function is amenable to Lagrange inversion, so it's less of a pain than the inverse of the ratio of two like in the general Schwarz triangle function.

It's possible there's some higher polygon where the Schwarz-Christoffel projection gives a really nice answer. I believe there are also efficient ways to approximate the Schwarz-Christoffel mapping for higher polygons.

For general triangles on the sphere, I know the hypergeometric function reduces to polynomials or other named functions with certain parameters. Maybe some of those parameters are ones used by the Schwarz triangle function applied to spherical triangles?

-brsr
daan
Site Admin
Posts: 977
Joined: Sat Mar 28, 2009 11:17 pm

Re: Snyder's equal-area projection

Post by daan »

brsr wrote: Tue Aug 31, 2021 5:39 pm New blog post, showing that the Collignon projection and the COBE Sky Cube projection are special cases of Snyder's equal-area projection:
https://brsr.github.io/2021/08/31/snyde ... -area.html . Also gives a closed-form formula for the inverse.
Very nicely done!
Milo wrote: Wed Sep 01, 2021 2:32 am I think the concept of polyhedral projections is cool, but I definitely think it should be possible to do better. I mean, take a look at this graticule. Is that thing even smooth?
No.
Milo wrote: Just performing a side-by-side comparison, the van Leeuwen projection shown here already looks much better than the Snyder one. But it still has some suspicious points, though I can't tell if they're actually smooth or not.
They’re not. (Speaking as co-author of the paper those were presented in.)
Milo wrote: Conformal projections are theoretically simple by comparison. By the Riemann mapping theorem, there only exists one possible conformal map on any given polyhedron (terms and conditions apply), so it's automatically the best. Though, I've still failed find to find any general-case formulae for that projection on the web, except that I know it involves some pretty hard-to-calculate functions.
Milo wrote: Wed Sep 01, 2021 6:46 pm I'm okay with trying to figure out how to use special functions, so long as I know which special functions, and I don't need to stack too many of them in a row. …Hypergeometric functions aren't something I've ever worked with, but they seem to at least be relatively well-supported by existing libraries (Wikipedia says they can be computed pretty quickly if you know what you're doing).
All of the Platonic solids can be computed via parameterizations of the Gauss hypergeometric function. That’s what I do in Geocart. However, I could not find any complex-valued implementation of the hypergeometric available publicly and so I spent about a week slogging through a custom implementation that included finding errors in the DLMF. Beware the notational thicket and subtleties involved in the descriptions of the hypergeometric. You need to normalize arguments via one of six (as I recall) transformations before sliding into the basic hypergeometric calculation. Also, there is a pair of singularities in the hypergeometric that seems to be intractable if it so happens that your specific range and parameterization hits it.
brsr wrote: Wed Sep 01, 2021 5:18 pm Are there any examples of such a projection other than the conformal ones?
Not that I have seen, but I agree that it should be possible.

There is a very nice explication of the Schwarz-Christoffel mapping by Driscoll and Trefethen. It’s not free.

— daan
Milo
Posts: 271
Joined: Fri Jan 22, 2021 11:11 am

Re: Snyder's equal-area projection

Post by Milo »

daan wrote: Sun Sep 05, 2021 7:01 pmHowever, I could not find any complex-valued implementation of the hypergeometric available publicly and so I spent about a week slogging through a custom implementation that included finding errors in the DLMF.
Huh. Good point. I've found a couple of libraries that offer hypergeometric functions, but usually only on real numbers.

Though that same site you linked suggests that Arb offers this feature. It does use a weird custom data type rather than normal floating point numbers, which might hamper performance, but then again you do get something out of it (if I'm understanding how this works correctly, then it would help with pixel interpolation).
brsr
Posts: 11
Joined: Sat May 22, 2021 5:25 pm

Re: Snyder's equal-area projection

Post by brsr »

A couple of comments on the non-differentiable lines in Snyder's projection. One is that the Shirley-Chiu transformation from the disk to the square has those same non-differentiable lines from the vertices to the center. If you want to find a differentiable equal-area polygon projection (or prove that it doesn't exist), maybe start with the Shirley-Chiu transformation so you don't have the change from one geometry to another complicating things.

The other is that you can coax a projection between a spherical triangle and a plane triangle out of the Snyder projection that lacks those lines and is almost equal-area. Let a triangle on the sphere be ABC. Don't subdivide that triangle, but apply the Snyder projection to that triangle and the cyclic relabeling of its vertices: ABC, BCA, CAB. Then average the barycentric results, keeping in mind which vertex is which: so beta_1 = (beta_{1,ABC} + beta_{3,BCA} + beta_{2,CAB})/3 and so on. On a icosahedron face the percent difference between highest and lowest flation is only 1.2%, and for a tetrahedron face it's 5.5%.

It's not differentiable along the edges of projected adjacent triangles, so you can't e.g. cut a square in two and make that a projection that's differentiable on the whole interior. Also I haven't figured out if it has an analytic inverse. (It's not just the average of the inverses, I tried that.)

-brsr
Post Reply