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 »

Milo wrote: Tue Feb 01, 2022 12:55 am
daan wrote: Tue Feb 01, 2022 12:14 amcos λ + i sin λ = ψ / |ψ| = sgn(ψ)
Come to think of it, isn't the cos λ + i sin λ part totally redundant? Absolute values are multiplicative (|a b| = |a| |b|), and so since you take the absolute value in the end anyway, cos λ + i sin λ can simply be reduced to 1.
Bwahaha. Excellent observation.
daan wrote: Tue Feb 01, 2022 12:14 amsin φ + 1 = (1 – |ψ|²)/(1 + |ψ|²)
This doesn't seem to be correct. Just looking at positive real values of psi, where you don't even need to take the absolute value, gnuplot gives me this:
Quite right. I mistakenly calculated only sin φ, not sin φ + 1.

More later.

— dean
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: Tue Feb 01, 2022 12:55 am Speaking of that factor 2 in the latter formula, when I plug in ψ = 1 (i.e., λ = φ = 0) in your formula for s, I get s = 1 / (√2 + 2)² = 1 / (√2 + 2)², a factor 2 off from the expected 1 / (3 + √8).
Transcribed wrongly from the paper. Updated. Thanks.

— 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 »

Milo wrote: Mon Jan 31, 2022 9:50 pm Incidentally, I didn't need to do anything about the sign in (1 ± 2 sin β cos β) (in the computation of ψ). I just used a consistent (1 - sin(2β)) and it works fine. In fact, using a plus sign gives nonsensical results that zoom in on a distorted Africa and ignore everything else.
Interesting observation, which I hereby confirm. I stuck with sin β, cos β because those values are already available from the iteration’s final calculation. If you don’t care about the extra computational cost for sin(2 β), no sign adjustments are needed. I’ll note that in the paper.

— 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: Tue Feb 01, 2022 1:37 pmInteresting observation, which I hereby confirm. I stuck with sin β, cos β because those values are already available from the iteration’s final calculation. If you don’t care about the extra computational cost for sin(2 β), no sign adjustments are needed. I’ll note that in the paper.
Huh? 2 sin β cos β = sin(2 β) for all β. Even the ones you should never reach.
gnuplot3.png
gnuplot3.png (45.91 KiB) Viewed 22135 times
You'll have cos β available if you cached it from doing the Newton-Raphson iteration. However, it's a hassle to save the cosine of every iteration to memory when you're only going to use the last one, so I didn't bother.

EDIT: I should note that this graph only demonstrates equality for real values of β, which isn't sufficient since I forgot that β can take complex values. However, a slightly more complicated gnuplot command still shows the equality to be satisfied for complex values as well.
Last edited by Milo on Tue Feb 01, 2022 6:48 pm, edited 1 time in total.
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: Tue Feb 01, 2022 2:17 pm
daan wrote: Tue Feb 01, 2022 1:37 pmInteresting observation, which I hereby confirm. I stuck with sin β, cos β because those values are already available from the iteration’s final calculation. If you don’t care about the extra computational cost for sin(2 β), no sign adjustments are needed. I’ll note that in the paper.
Huh? 2 sin β cos β = sin(2 β) for all β. Even the ones you should never reach.
What I can actually confirm is that I’m paying insufficient attention. There was a time when the sign adjustment was needed before I’d distilled the formulas down so much, but I never revisited the matter when I reached the current state.

— 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 »

Milo wrote: Mon Jan 31, 2022 9:50 pm I'm still missing this part:
daan wrote: Mon Jan 31, 2022 1:42 pmMy paper describes a reasonably simple test for determining whether z is outside the range, which I omit here.
The points for which z ∉ E can be detected by β’s value thus: If we treat β as its own projection, we find that it has an oval shape bounded by the 180th meridian on both sides (see earlier images). If we project its boundary and designate it β_b, we find that
ℝ[β_b(φ)] = φ / 2
𝕀[(β_b(φ)] = (1/2) ln (2 cos φ + 2 √(cos φ + cos²φ) + 1)
Therefore, given any particular value for β, we can compute the latitude φ on β_b(φ) where ℝ[β_b(φ)] = ℝ[β(φ)], and therefore we know the maximum value that 𝕀[β(φ)] can have as per above. Hence, if |𝕀[β(φ)]| > 𝕀[β_b(φ)], the point should be discarded.

— 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: Tue Feb 01, 2022 5:06 pmThe points for which z ∉ E can be detected by β’s value thus: If we treat β as its own projection, we find that it has an oval shape bounded by the 180th meridian on both sides (see earlier images). If we project its boundary and designate it β_b, we find that
ℝ[β_b(φ)] = φ / 2
𝕀[(β_b(φ)] = (1/2) ln (2 cos φ + 2 √(cos φ + cos²φ) + 1)
Hmm, so while β looks oval-ish, it's not actually a proper ellipse.

Some attempts at reformulation:
2 cos φ + 2 √(cos φ + cos²φ) + 1 = (√(cos φ + 1) + √(cos φ))2 = (√2 cos(φ/2) + √(cos φ))2
The half-angle formula probably just complicates things, but the intermediate formula probably does make things neater, particularly since you can move the square out of the logarithm:
(1/2) ln (2 cos φ + 2 √(cos φ + cos²φ) + 1) = ln (√(cos φ + 1) + √(cos φ))
That's one more evaluation of √ in return for several less multiplications and additions, which might or might not be an improvement depending on how fast evaluating √ is. It's at the very least easier to read.

Incidentally, this means that β has an aspect ratio of asinh(1) : atan(1). That seems pretty evocative, considering the Gudermannian function...
daan wrote: Tue Feb 01, 2022 5:06 pmTherefore, given any particular value for β, we can compute the latitude φ on β_b(φ) where ℝ[β_b(φ)] = ℝ[β(φ)], and therefore we know the maximum value that 𝕀[β(φ)] can have as per above. Hence, if |𝕀[β(φ)]| > 𝕀[β_b(φ)], the point should be discarded.
This doesn't seem to be the whole story. It cuts off most of the out-of-bounds projection, but it still leaves me with this:
eisenlohr1.png
eisenlohr1.png (484.23 KiB) Viewed 22125 times
When I also add a requirement that |ℝ[β]| ≤ π/4, I get this:
eisenlohr2.png
eisenlohr2.png (442.59 KiB) Viewed 22125 times
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: Tue Feb 01, 2022 7:50 pm
daan wrote: Tue Feb 01, 2022 5:06 pmTherefore, given any particular value for β, we can compute the latitude φ on β_b(φ) where ℝ[β_b(φ)] = ℝ[β(φ)], and therefore we know the maximum value that 𝕀[β(φ)] can have as per above. Hence, if |𝕀[β(φ)]| > 𝕀[β_b(φ)], the point should be discarded.
This doesn't seem to be the whole story. It cuts off most of the out-of-bounds projection, but it still leaves me with this:
I’m confused about how that could happen. The heuristic I give limits the range of β to the boundary of β. That must result in a 1-to-1 mapping of the sphere. The results you show imply a 1-to-many mapping of the sphere.

Can you give me a definite z outside of βb that does not get weeded out by this heuristic? I will examine its behavior in my environment so that we can figure out what’s going on.

Thanks.
— 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: Tue Feb 01, 2022 11:02 pmCan you give me a definite z outside of βb that does not get weeded out by this heuristic?
Well, that's easy enough from reading pixel coordinates in an image editing program.

One coordinate that seems to do the trick is E = 0.4... no wait, E = 0.8i with your multiplier (I omitted it internally because it just gets in the way).

Here's a traceback from a few pixels in the biggest blob:

Code: Select all

(400,94)
E/2i     = +0.406957-0.000666i
beta[1]  = +0.982480-0.001608i
beta[2]  = -0.007348-0.005607i
beta[3]  = +0.982518-0.001469i
beta[4]  = -0.007153-0.004853i
beta[5]  = +0.982526-0.001491i
beta[6]  = -0.007106-0.004971i
beta[7]  = +0.982523-0.001489i
beta[8]  = -0.007122-0.004960i
beta[9]  = +0.982524-0.001489i
beta[10] = -0.007118-0.004960i
beta[11] = +0.982524-0.001489i
beta[12] = -0.007119-0.004960i
cos(2*real(beta)) = 0.999899
ln(sqrt(cos+1)+sqrt(cos)) = 0.881338 >= |imag(beta)| = 0.004960

(400,95)
E/2i     = +0.405624-0.000666i
beta[1]  = +0.979264-0.001608i
beta[2]  = -0.018714-0.005761i
beta[3]  = +0.979800-0.001241i
beta[4]  = -0.015771-0.003704i
beta[5]  = +0.979661-0.001410i
beta[6]  = -0.016532-0.004642i
beta[7]  = +0.979690-0.001348i
beta[8]  = -0.016376-0.004296i
beta[9]  = +0.979686-0.001369i
beta[10] = -0.016393-0.004416i
beta[11] = +0.979685-0.001362i
beta[12] = -0.016401-0.004378i
cos(2*real(beta)) = 0.999462
ln(sqrt(cos+1)+sqrt(cos)) = 0.881183 >= |imag(beta)| = 0.004378

(400,96)
E/2i     = +0.404292-0.000666i
beta[1]  = +0.976048-0.001608i
beta[2]  = -0.030395-0.005923i
beta[3]  = +0.977560-0.000990i
beta[4]  = -0.021903-0.002362i
beta[5]  = +0.976851-0.001433i
beta[6]  = -0.025867-0.004880i
beta[7]  = +0.977142-0.001177i
beta[8]  = -0.024239-0.003427i
beta[9]  = +0.977024-0.001325i
beta[10] = -0.024897-0.004266i
beta[11] = +0.977068-0.001246i
beta[12] = -0.024652-0.003817i
cos(2*real(beta)) = 0.998785
ln(sqrt(cos+1)+sqrt(cos)) = 0.880944 >= |imag(beta)| = 0.003817

(400,97)
E/2i     = +0.402960-0.000666i
beta[1]  = +0.972832-0.001608i
beta[2]  = -0.042408-0.006093i
beta[3]  = +0.975848-0.000712i
beta[4]  = -0.025152-0.000816i
beta[5]  = +0.973901-0.001540i
beta[6]  = -0.036225-0.005622i
beta[7]  = +0.975014-0.000907i
beta[8]  = -0.029877-0.001943i
beta[9]  = +0.974341-0.001411i
beta[10] = -0.033704-0.004855i
beta[11] = +0.974724-0.001047i
beta[12] = -0.031527-0.002750i
cos(2*real(beta)) = 0.998013
ln(sqrt(cos+1)+sqrt(cos)) = 0.880670 >= |imag(beta)| = 0.002750

(400,98)
E/2i     = +0.401628-0.000666i
beta[1]  = +0.969616-0.001608i
beta[2]  = -0.054769-0.006272i
beta[3]  = +0.974721-0.000403i
beta[4]  = -0.025096+0.000941i
beta[5]  = +0.970676-0.001690i
beta[6]  = -0.048470-0.006677i
beta[7]  = +0.973568-0.000481i
beta[8]  = -0.031675+0.000489i
beta[9]  = +0.971315-0.001664i
beta[10] = -0.044706-0.006472i
beta[11] = +0.972961-0.000605i
beta[12] = -0.035170-0.000232i
cos(2*real(beta)) = 0.997527
ln(sqrt(cos+1)+sqrt(cos)) = 0.880498 >= |imag(beta)| = 0.000232

(400,99)
E/2i     = +0.400296-0.000666i
beta[1]  = +0.966400-0.001608i
beta[2]  = -0.067499-0.006461i
beta[3]  = +0.974246-0.000059i
beta[4]  = -0.021315+0.002908i
beta[5]  = +0.967146-0.001818i
beta[6]  = -0.062926-0.007681i
beta[7]  = +0.973149+0.000101i
beta[8]  = -0.027562+0.003839i
beta[9]  = +0.967652-0.001970i
beta[10] = -0.059844-0.008550i
beta[11] = +0.972451+0.000195i
beta[12] = -0.031573+0.004398i
cos(2*real(beta)) = 0.998007
ln(sqrt(cos+1)+sqrt(cos)) = 0.880668 >= |imag(beta)| = 0.004398

(400,100)
E/2i     = +0.398964-0.000666i
beta[1]  = +0.963184-0.001608i
beta[2]  = -0.080616-0.006660i
beta[3]  = +0.974499+0.000327i
beta[4]  = -0.013397+0.005075i
beta[5]  = +0.963438-0.001835i
beta[6]  = -0.078999-0.008063i
beta[7]  = +0.973989+0.000686i
beta[8]  = -0.016252+0.007120i
beta[9]  = +0.963536-0.001995i
beta[10] = -0.078366-0.009058i
beta[11] = +0.973775+0.000948i
beta[12] = -0.017447+0.008614i
cos(2*real(beta)) = 0.999391
ln(sqrt(cos+1)+sqrt(cos)) = 0.881158 >= |imag(beta)| = 0.008614
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.)

I'm going to try a version which tests every individual iteration of beta for |ℝ[β]| ≤ π/4. This could be a problem if out-of-bounds values can happen in intermediate steps of iterations that do eventually converge, but I'm going to just take a gamble and hope that doesn't happen.
eisenlohr3.png
eisenlohr3.png (463.09 KiB) Viewed 22114 times
...Too bad, it does. This is too aggressive and eliminates pixels that should clearly be part of the projection.
PeteD
Posts: 251
Joined: Mon Mar 08, 2021 9:59 am

Re: Eisenlohr’s optimal conformal map of the world

Post by PeteD »

Milo wrote: Tue Feb 01, 2022 7:50 pm This doesn't seem to be the whole story. It cuts off most of the out-of-bounds projection, but it still leaves me with this:
eisenlohr1.png
eisenlohr1.png (606.47 KiB) Viewed 22111 times
The earth is a neutron star! ;)
neutron star.jpg
neutron star.jpg (41.24 KiB) Viewed 22111 times
Post Reply