7

I'd like to visualize the longitudes on a sphere from close-up, with correct perspective. It seems this is the "Blue Marble" problem i.e. to show how earth looks from a realistic distance (say 0.5 to 4 earth radii), and not from infinity with visible poles.

drawing by hand

These are 6 ellipses fitted into the visible horizon. Note that the poles have both sunken below the horizon; the upper pole is marked by a small circle.

It is not easy to fit the ellipses into the circle by hand, because the center is shifted to the right, and both height and width have to be adapted.

I do have 5 points to nail it down: both poles, the chosen intersection with the x-axis, and the two tangent points with the circle. With only the y component of the center known (=0), I would start with this equation:

$$\frac{(x - x_o)^2}{a^2} + \frac{y^2}{b^2}=1$$

with the three unknowns $x_0, a$ and $b$.

The poles give two points on the ellipse.

Now I would add a chosen third point on the x-axis, for purple about (0.7, 0).

This leaves me with a bundle of ellipses: some wider than tall running to the left; some very high poking through the horizon, some too short to touch the circle from the inside.

I gather - and faintly recall from school - that I can find a single solution with a discriminant of zero.

So can anybody tell me how to proceed from here? Can it be done with (simple, maybe messy) algebra, or is there a shortcut? Do I have to find that 4th and symmetric 5th point first and then determine the ellipse?

Thank you


Added after comment:

Yes the uniform change in angle is important; now at least I can determine where I want the meridians (x-axis crossing would be a bit more practical), while by hand I had to leave them more or less where they fit.

My goal is to put the 0-degree and 41E-degree fulldisc satellite images side by side and stretch them so I can merge them with a straight 20.5 meridian. This works quite well, but only after I changed/softened the stretching point from 1-x (the circle) to 1-sqrt(x) by trial and error.

My graphic is meant as a test grid. I did not find anything similar on the internet. This is the usual perspective:

usual

This is not central:

wire

A "globe beach ball" from walmart comes - also literally speaking - closest:

beach ball

And this is my result for now on youtube. The projection itself is not fantastic, but at least the seam in the middle is gone. There is also a "Mollweide" projection by NOAA where they combined East and West coast satellites.

But a correctly drawn complete grid would look nice on its own: shows the "fatness" of a sphere. That would be distance to determine the (un)visible poles, and degrees to choose the ellipse? I think that really is what I want!

neslrac
  • 185
  • 1
    Knowing that the entire figure is a central projection of a sphere onto a plane, and that the circle is a great circle passing through a known axis of the sphere (the axis being parallel to the projection plane), all the data you want can be calculated from the angle the circle's plane makes with the projection plane. If you must start with a chosen intersection with the $x$-axis, you can compute the angle from that, but if I were drawing meridians for the sake of meridians, I think I would put them at uniform changes in angle. Are you interested in such an approach? – David K Nov 30 '22 at 13:50
  • 1
    @DavidK You are absolutely right, a uniform change of angles makes a big difference. Of course I'm interested. I added a part in my Q to show what I'm at. I think this already cost me 2 of the 6(!) upvote points I had. – neslrac Dec 01 '22 at 16:13
  • @neslrac I have a question for you. Do you know how to find the perspective projection of a point $P$ when viewed by an observer standing at point $E$? If you do, then this is all you need to find the perspective projection of the longitudes, because these great circles can be described by simple parametric equations, and all you need to do then, is discretize the "angle" $\theta$ over $[0, \pi]$ and find the projection of each $"3D"$ point to convert it to a "2D" projection. And finally, you need to draw the projection of the boundary of the globe, which is a circle but not a great circle. –  Dec 02 '22 at 00:29
  • To find the equation of the boundary take a cross section that passes through the observer eye "E" and the center of Earth (the globe), drop tangents from "E" to the cross section of the globe sphere (which is a circle having the radius of the sphere), and a little bit of trigonometry you can calculate the center of the circle, its radius, and the normal vector to its plane. You can now parametrize the boundary by two vectors that are perpendicular to the viewing direction, then you can discretize the angle $t$ that parametrizes the boundary circle and obtain the perspective projection of it. –  Dec 02 '22 at 00:35
  • Please check my attached solution, to see the longitudes I got with the above-described method. –  Dec 02 '22 at 00:37

2 Answers2

5

Here's one way to do it. Assume the blue silhouette $c$ is the unit circle $x^2+y^2-1=0$, and that the poles are at $(0,\pm a)$. We wish to find the ellipse $e$ passing through the poles and tangent to the circle at the points that are the intersection of the circle with the line $x=b$, i.e. the points on the circle with $x$-coordinate $b$.

In general,when conics $c$ and $e$ touch (are mutually tangent) at two points $P,Q$ they are said to be in double contact. If $\ell=0$ is the equation of the line $PQ$, a conic in double contact with $c$ at the points $c\cap \ell$ is given by the equation $c+s\ell^2=0$ for some $s$. So in our case we need to solve for such a conic passing through the poles.

Here $\ell=0$ is the line $x-b=0$, so we are solving for $s$ such that $c+s\ell^2=x^2+y^2-1+s(x-b)^2=0$ passes through $(0,a)$. This gives us $s=\dfrac{1-a^2}{b^2}$.

So the family of ellipses corresponding to the perspective projections of circles of longitude is

$$ x^2+y^2-1+\dfrac{1-a^2}{b^2}(x-b)^2=0 $$

Note that values of $b$ in the interval $(-1,1)$ correspond to lines of longitude that are partially visible in this perspective. Values of $b$ outside of this interval will correspond to lines that are entirely occluded (i.e. on the far side of the silhouette).

Update (Feb 2024): A related question came up on $\mathbb X$ (formerly Twitter) recently - how to draw a perspective view of a planar slice of a quadric. The question and answer are in this $\mathbb X$ thread.

brainjam
  • 9,172
  • Wow this looks great! I'll try it out. The vertical line x = b makes sense to me, but squaring it as (x-b)^2 is quite magical. So I don't need the center and the major and minor semis, you give me "only" a corrected circle equation, where a and b mean something else? (my chosen 2x2 symmetrical points directly: the poles' y and the tangent points' x). Very elegant, thank you! – neslrac Nov 28 '22 at 10:59
  • @neslrac, I should have specified that a and b meant something else. Sorry for any confusion. – brainjam Nov 28 '22 at 13:52
  • I think your "way to do it" is great. But yes now I am slightly confused. I am able to plot your equation myself, pixelated and with vertical gaps. Also easy to use b as cut-off to hide the lines on one side of the horizon. But I somehow really expected an ellipse, not a function, however elegant. I don't see how I can go back to my original scalable vector graphic where an ellipse is drawn (nicely) by its cx, cy, rx and ry, with stroke and filling. True, I asked for a shortcut, but now my unknowns x0, a and b are still...unknown. – neslrac Nov 28 '22 at 22:08
  • Well I started by multiplying out the equation but gave up because I didn't see how I could reach something resembling standard form -- too many x. So I do multiply out to get the "a,b,c,d,e" form, and from there the standard form by "completing the square"? It is just a systematic rearrangement? – neslrac Nov 29 '22 at 00:30
  • I finally made a new question so to stop the commenting...I have a solution, but it looks like we had some misunderstandings. Thanks again! – neslrac Nov 29 '22 at 20:46
  • @neslrac - yes, good idea. I was going to suggest something similar. Meanwhile I've deleted a bunch of comments to comply with MSE's guidelines discouraging long discussions in the comment section. – brainjam Nov 29 '22 at 22:24
  • Something I don't understand, the longitudes of the globe should be constructed from their position on the globe as great circles passing through the two poles, and then projected on a projection plane using perspective projection. Certainly, they are not constructed the way that is described in this problem, by fitting ellipses to a circle. –  Dec 01 '22 at 19:02
  • @Nathalie - you are right, but the OP appeared to want a way to construct ellipses that had double contact with the circle, and I ran with that. I believe you'd get the same ellipses by projecting from great circles, and I'd be interested in seeing somebody's description of how to do that. DavidK has offered, and maybe you'd be interested as well. At the end of the day OP is interested in ellipse centers and major/minor radii that they can use as SVG drawing parameters. – brainjam Dec 01 '22 at 21:22
2

Not an answer, but to show what I got as the perspective projection of the longitudes. Some pointers on how I got this image are found in my comments above. The dark blue colored segments are the visible part of the projected longitudes while the gray segments are the invisible part. I've also added the globe latitudes in the following image where the gray color for the invisible segments has been replaced with light green. The third image has the meridians (the longitudes) symmetrical. The fourth image depicts the view observed $4$ times the radius of the sphere away from the center of the sphere, and lying on the equatorial plane.

enter image description here enter image description here enter image description here enter image description here

  • I do "know" about perspective projection after I made my own "modern" OpenGL program without any helper libraries. It's done by multiplying different 4x4 matrices (Transposition x Rotation -> View, View x Projection -> Camera-Matrix, which is fed to the vertex shader). But OpenGL has no round primitives, and I thought for a good reason. I wonder how you can draw such perfect (rotated) ellipses and still know if they are hidden. – neslrac Dec 02 '22 at 12:03
  • Roundness comes from the drawing library of Microsoft Excel that I used for this project, it generates a smooth curve passing through a set of points. –  Dec 02 '22 at 12:25
  • As for determining the cut point (which are the tangency points with the circular boundary), you have to solve the follwoing simple trigonometric inequality. If the parametric equation of the circle is $P(t) = V_0 + V_1 \cos t + V_2 \sin t $ where $P(t)$ is the "3D" vector, and $E$ is the eye of the observer, then you want $(E - P) \cdot P \ge 0 $. If $R$ is the radius of the sphere, then this reduces to $ (V_1 \cdot E) \cos t + (V_2 \cdot E) \sin t \ge R^2 - (V_0 \cdot E) $. The invisible range is found by reversing the inequality. –  Dec 02 '22 at 12:26
  • The southern pole has perspectively moved to the center because it is further away (compare to the "not central" example, which is also "flat"). A pity you didn't make the meridians symmetrical which I think would help the eye a lot. As a demonstration this is very impressive; I'd try out some central/aequatorial views from different distances, also closer than geostationary orbit, and with a few more meridians and equal amount of parallels/latitudes. But this must be quite a bit more complex than my pure 2D solution for which the AA provides the conic-section equation. – neslrac Dec 02 '22 at 12:42
  • I've added a new image with the meridians symmetrical. Also, the angle division for meridians and latitudes are the same, so that near the equator, the grid is almost square. –  Dec 02 '22 at 13:20
  • Technically you've convinced me. It is a matter of taste from how far and at which vertical angle it looks best . To simulate a weather satellite it should be hovering 36000 km (i.e. 6x radius) above the equator. But I get your message: simple trigonometry! I'll see...thanks a lot! – neslrac Dec 02 '22 at 15:36
  • Nice! Can you add a picture with the viewpoint in the equatorial plane and a few radii away? – brainjam Dec 02 '22 at 16:06
  • 1
    @brainjam Sure. Check my updated solution that includes the picture that you requested. –  Dec 02 '22 at 16:28