Eisenlohr’s optimal conformal map of the world

General discussion of map projections.
daan
Site Admin
Posts: 977
Joined: Sat Mar 28, 2009 11:17 pm

Re: Eisenlohr’s optimal conformal map of the world

Post by daan »

PeteD wrote: Wed Feb 02, 2022 12:53 am The earth is a neutron star! ;)
:D
daan
Site Admin
Posts: 977
Joined: Sat Mar 28, 2009 11:17 pm

Re: Eisenlohr’s optimal conformal map of the world

Post by daan »

Milo wrote: Wed Feb 02, 2022 12:37 am Here's a traceback from a few pixels in the biggest blob…

What I'm noticing on looking at it now is that beta seems to flip-flop between two values, one close to 0 and one close to 1, with the one close to 0 "winning out" because I'm doing an even number of iterations. The other value, on the other hand, would have easily been thrown out because the real part is greater than pi/4.

The discrepancy might be related to that I'm not performing this step:
daan wrote: Mon Jan 31, 2022 1:42 pmIf ever |δ[n+1]| ≥ |δ[n]|, you can discard the point as being outside of E’s range. However, not every point that converges is within E’s range.
because (A) you said that it's not a sufficient condition anyway, and (B) rounding errors mean that every iteration will start flip-flopping between two similar values eventually, so this test would hit false positives unless I add a clause about treating "small enough" deltas as zero, which would require me to arbitrarily decide what counts as "small enough". (My usual test, "if(beta - delta == beta)", didn't work, as the process never reached that level of precision for some reason.)
Okay. It’s clear what is going on: you’ve got that flip-flopping going on, and when your program happens to select the value of β with the lower absolute value, it satisfies the test that keeps the point instead of getting weeded out for being outside of E. You’ll note that I state that the iteration converges to better than 13 digits’ accuracy, so what I do is terminate the loop with success whenever |δn|² ≤ 10-26. I also terminate if |δn+1| ≥ |δn|, but the latter case indicates failure when occurring before satisfying the former test.

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

Re: Eisenlohr’s optimal conformal map of the world

Post by Milo »

daan wrote: Wed Feb 02, 2022 1:51 amYou’ll note that I state that the iteration converges to better than 13 digits’ accuracy, so what I do is terminate the loop with success whenever |δn|² ≤ 10-26.
I can't do that exactly, because I'm currently using single-precision floating point numbers, which don't even have that many digits of precision. (Honestly, I doubt that using single-precision instead of double-precision floats gives as much of a performance boost as I imagine it doing, and I suspect that vagaries of the C language make it occasionally sneakily use double-precision math anyway, so this is more for the sake of a placebo effect, really. Still, in theory, single-precision floats should easily still have enough digits for accurately rendering any projection that fits on a computer screen.)

I could ad-hoc a cutoff that works for the level of precision I'm working with, but I would really prefer a solution with a more theoretical basis.

What I'd really like is a solution that works on E directly. Notably, while the Eisenlohr projection has interruptions on some horizontal lines, it doesn't on vertical lines, so knowing a point's x coordinate should allow computing a bound on its y coordinate. That doesn't mean, however, that it has a conveniently-workable formula.

So far, the best I can manage is that when:
ℝ[β] = φ / 2
𝕀[β] = ln (√(cos φ + 1) + √(cos φ))
then:
ℝ[√2 sin ββ] = sin φφ / 2
𝕀[√2 sin ββ] = √(cos φ + 1) ⋅ √(cos φ) - ln (√(cos φ + 1) + √(cos φ))
This checks out against the limits computed earlier. Unfortunately, we want to compute a boundary on the (simpler) real part given the (more complicated) imaginary part, which is the opposite of how we'd prefer to do things. (And even sin φ - φ / 2 requires numerical computation to solve.) Naturally, needing to solve this numerically would give negligible benefit over computing β first and working with that.

On a distantly-related note, do you know a closed form for the total area of the Eisenlohr projection? Like how the Lagrange projection, when normalized to have scale 1 at the center, has a total area of 16π.
daan
Site Admin
Posts: 977
Joined: Sat Mar 28, 2009 11:17 pm

Re: Eisenlohr’s optimal conformal map of the world

Post by daan »

I don’t think you can escape the numerical realities of floating-point computations. Unless you use interval arithmetic, you are going to lose bits along the way except for very specific kinds of calculations. It can get bad enough for real-valued calculations, but complex-valued computations are inherently more “lossee” than real-valued for almost any purpose due to the cross-“contamination” between real and complex values for any multiplicative-like operation: you’re invariably doing subtractions, and the subtractions are often against similar values.

I agree it’s a little empirical to say “just cut it off when you reach n digits of convergence” because (in this example) you could theoretically include some values of x, y that are slightly outside of E. Also, theoretically, you wouldn’t have proved that all legitimate values are able to converge to that accuracy given floating-point inaccuracies. However, it does not matter what test you use even if the calculation is closed-form; that test is going to come with numerical inaccuracies whereby you’re not going to be able to claim certainty regardless of the analytical facts.

As for your tests directly against E, I get the same results. Nor do I find any way to parameterize ℝ(Eλ=π) and 𝕀(Eλ=π) in a way that presents a closed-form solution. For example, I looked into series expansions to see if there were commonalities that could be extracted. No such luck; the two axes are just very different expressions in real values. The β intermediary seems like the way to go.

Looking into the area of E

Cheers,
— daan
daan
Site Admin
Posts: 977
Joined: Sat Mar 28, 2009 11:17 pm

Re: Eisenlohr’s optimal conformal map of the world

Post by daan »

daan wrote: Thu Feb 03, 2022 2:16 pm Looking into the area of E
(Assuming I haven’t messed something up,) It comes down to 2π – 8∫0π/2 φ sin(φ)/√(1 + sec(φ)) . The integral stumps Maxima, Mathematica, and Maple, so I presume it’s not integrable in closed form. There are ways of evaluating definite integrals that I don’t know much about but that those programs sometimes know things about. They are still stumped. I can’t say for sure that the case is closed, but it’s not looking good. I have a suspicion that, if there is a closed form, it includes a √2 factor, and once factoring that out, what’s left is not a rational multiple of π or π². I get that from the Taylor series expansion.

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

Re: Eisenlohr’s optimal conformal map of the world

Post by Milo »

I've managed a few reformulations of
φ sin(φ)/√(1 + sec(φ))
giving
φ √(sin(2 φ) tan(φ/2) / 2)
φ sin(φ/2) √(2 cos(φ))
but Maxima still won't integrate those, so I don't think this helps.

I tried numerical integration, which tells me the integral is somewhere in the vicinity of 0.482003, but not much more than that.

That means an area of 2.42716 when normalized to scale 1 at the boundary, 82.4520 when normalized to scale 1 at the center, or 2.13720 when normalized to have a maximum |x| extent of 1. That last one calculates to an expected 341952 pixels at forum size, closely matching the actually-drawn 341956 pixels below.

Corollary: for an Eisenlohr projection at 800 pixels wide (the maximum the forum will accept), a Lagrange projection with the same scale at the center would have a diameter of 515 pixels, while a Lagrange projection with the same total area would have a diameter of 660 pixels.
daan wrote: Thu Feb 03, 2022 2:16 pmIt can get bad enough for real-valued calculations, but complex-valued computations are inherently more “lossy” than real-valued for almost any purpose due to the cross-“contamination” between real and complex values for any multiplicative-like operation: you’re invariably doing subtractions, and the subtractions are often against similar values.
Yeah, I figured as much.

It was worth a try, but in the end I'll just have to swallow my pride and do things the ugly way.

I found a cutoff that works for single-precision floats, at least when projecting to 800 pixels. It takes more iterations than expected to reach the specified accuracy, and larger projections such as 2400 pixels still get some false negatives, which probably can't be helped without just switching to double-precision math like I probably should have been using from the start.

For now I'm still not doing the "if delta increases from last time" test. I just decide that if the sequence still hasn't reached the desired level accuracy after a fixed number of iterations, then it doesn't converge.

Result:
eisenlohr.png
eisenlohr.png (437.52 KiB) Viewed 23297 times
Here's what I get when I omit pixels where β doesn't converge, but don't do the subsequent "if β is out of bounds" test:
eisenlohr-extended.png
eisenlohr-extended.png (715.21 KiB) Viewed 23297 times
...And just for fun, here's an attempt that didn't work out so great:
eisenlohr-powdered.png
eisenlohr-powdered.png (245.55 KiB) Viewed 23297 times
Milo
Posts: 271
Joined: Fri Jan 22, 2021 11:11 am

Re: Eisenlohr’s optimal conformal map of the world

Post by Milo »

One more thing.

The dirty secret of pseudocylindrical and lenticular projections in general is that they work mostly because they push off the worst of their distortion into the Pacific Ocean. If you try to project them in an aspect which puts America on the right (I recommend a central meridian of 154°E), the illusion vanishes and the projection's distortion becomes a lot more obvious.

For example:
eisenlohr+154.png
eisenlohr+154.png (502.25 KiB) Viewed 23297 times
lagrange+154.png
lagrange+154.png (323.52 KiB) Viewed 23297 times
And since I'm allowed three images per post, here's an equal-area projection for comparison:
mollweide+154.png
mollweide+154.png (375.27 KiB) Viewed 23297 times
The Lagrange projection is the only one that looks even remotely decent. Some areas get distorted, of course (even if you don't care about Greenland, try comparing, say, New Guinea versus Madagascar), but the continents look about right. I'm actually surprised at how well it does.

(The whitish streak in the top-center of the Lagrange projection is, on closer inspection, a flaw in my source image, so blame NASA for that.)

And that's why plain old cylindrical projections, which treat all meridians equally, should not be snubbed, despite their simplicity and severe distortion at high latitudes. (Still try to avoid Gall-Peters, though. There are better choices of standard parallel.)

Oh, and you might notice that the Eisenlohr and Lagrange projections (normalized to the same scale at the center) are almost exactly the same height. That's true, but it's a coincidence. The actual ratio is something like 3.991617295910950673837:4.
quadibloc
Posts: 292
Joined: Sun Aug 18, 2019 12:28 am

Re: Eisenlohr’s optimal conformal map of the world

Post by quadibloc »

This is very interesting. I know that I saw a description of the Eisenlohr projection somewhere that actually showed the "beta" projection.
Also, it's interesting that the Lagrange projection has lower distortion than the Eisenlohr over a large part of the world. However, if you compared the Eisenlohr to August's Conformal the Eisenlohr would fare even worse.
Milo
Posts: 271
Joined: Fri Jan 22, 2021 11:11 am

Re: Eisenlohr’s optimal conformal map of the world

Post by Milo »

quadibloc wrote: Fri Feb 04, 2022 10:25 pmHowever, if you compared the Eisenlohr to August's Conformal the Eisenlohr would fare even worse.
I don't feel like implementing the August epicycloidal projection or exactly calculating its distortion, but G.Projector offers it as an option, so here's the same 154°E aspect as above for comparison:
august.png
august.png (559.65 KiB) Viewed 23288 times
(Note: not normalized to the same scale.)
It looks very similar to the Eisenlohr projection, with the same ridiculous exaggeration of Africa's western lobe. The distortion is slightly less extreme, but still far more noticeable than in the Lagrange projection.

As far as I know, while the Eisenlohr and Lagrange projections are both mathematically optimal by different metrics, the August projection is not optimal in any way and is simply something Friedrich August thought looked good from eyeballing it.
daan
Site Admin
Posts: 977
Joined: Sat Mar 28, 2009 11:17 pm

Re: Eisenlohr’s optimal conformal map of the world

Post by daan »

Milo wrote: Sat Feb 05, 2022 12:02 am As far as I know, while the Eisenlohr and Lagrange projections are both mathematically optimal by different metrics, the August projection is not optimal in any way and is simply something Friedrich August thought looked good from eyeballing it.
It is true that August has rather greater normalized area than Lagrange.

— daan
Post Reply