1

I'm trying to find a nice algorithm to trace a sky route between 2 points of a planet.

Here is where I am : https://dl.dropboxusercontent.com/u/17657227/migrationGlobe/index.html

(or here http://xseignard.github.io/migrationGlobe/)

I tried Cubic (red line) and Quadratic (white one) bezier curves, but as you can see, results are bad!

The line is supposed to go from France (Nantes) to Australia (Canberra), and we see the line passing through the globe.

You can also see control points for each bezier cuve materialized by the squares.

Do you know what could be a good algorithm to create a nice sky route?

Something like this: http://www.senchalabs.org/philogl/PhiloGL/examples/worldFlights/

i.e flatter lines and not crossing the globe.

Thanks!

2 Answers2

2

It looks like you have things basically correct. I'd recommend that you use cubic Bezier curves. Let's start with this picture:

enter image description here

I assume you know the start point $\mathbf{P}_0$ and the end point $\mathbf{P}_1$ of the flight, and you know the starting and ending tangent lines, too. We need to place the Bezier control points $\mathbf{P}_a$ and $\mathbf{P}_b$ on these tangent lines. The only question is how far along the tangent lines we should go.

So, first decide where you want to place the mid-point $\mathbf{M}$ of the flight. I suppose $\mathbf{M}$ will be at some height above the surface of the earth. Then, with a little geometry, you can figure out the points $\mathbf{P}_r$ and $\mathbf{P}_s$ and the distance $d$. Then place the Bezier points on the end tangent lines so that $\|\mathbf{P}_a - \mathbf{P}_0\| = \tfrac43 d$ and $\|\mathbf{P}_b - \mathbf{P}_1\| = \tfrac43 d$. This will give you a Bezier curve that passes through the point $\mathbf{M}$.

bubba
  • 44,617
1

You can use great circle arcs to find the shortest path on a sphere which connects two given points. So this would work for paths on the surface of the earth, or at constant height. If you don't want that constant height, you can try to add some height profile to that: either you fly most of the time at constant height, with a relatively short starting and landing phase, or you assume that the path climbs half the way and drops the other half.

Since your question is tagged with Bézier curve, and you only want nice not physically correct solutions, I'd consider the following: A great circle is a circle, and as such cannot be exactly represented by a Bézier curve (with the exception of rational Bézier curves). It can however be approximated fairly well. So for the climb half drop half height profile I'd try this: split your circle into two equal arcs on the sphere, then raise the altitude of the joining point while maintaining the positions of the adjacent controlpoints relative to this point.

For the solution with starting and landing phase, I'd rather introduce three cuts: Start with the elevated circle, and cut it in half since you should never approximate more than quarter orf a circle using a single Bézier segment. Then add additional split points a fixed distance after the beginning and a fixed distance before the end of the path. Change the locations of these end points so that they lie on the surface of the globe. Try whether moving the adjacent control points along looks good, or whether you should rather leave them at their raised altitude.

I've not tried any of this yet.

MvG
  • 44,006