# Given two lat/long/time points I need to extrapolate an entire path along the earth

Given two points and the times between them, I'd like to draw a line around the earth.
Everything I've tried led to some crazy lines, due to my inexperience with longitudinal movements.

Here is the code I'm using:

``````\$orbx = \$actualx - 1;
\$orby = \$actualy;
\$steps = 360;
\$fullorbit = "\$actualx,\$actualy,\$elevation";
while (\$steps-- > 0) {
\$orbx = getDegreesLat(\$orbx);
\$orby = getDegreesLon(\$orby);
\$fullorbit .= " \$orby,\$orbx,\$elevation";
\$orbx -= 1;
\$orby += 0;
}
\$fullorbit .= " \$actualx,\$actualy,\$elevation";
``````

Of course, my line looks perfect as long as I'm translating only latitude, how can I make this work for both latitude and longitude?

• Remember that earth is a sphere, not a plane! – Alex Leith Oct 1 '12 at 23:55
• Yeah, that's my problem. I'm not sure how to compensate. – Korvin Szanto Oct 1 '12 at 23:56
• There are some puzzling aspects to this question. The code suggests you are estimating an orbit, which will be elliptical--but this is not possible from just two points. Another is the mention of times: how is this supposed to enter into computing the path? Finally, in what form precisely will be the input and what form should the output be? For instance, should the points be in (lat, lon, elevation) and if so, is (lat, lon) geodetic or spherical? Should the output be a parameterized equation or a set of vertices? If the latter, at what spacing? – whuber Oct 2 '12 at 5:02
• For this case, we're assuming constant elevation, the time is not really relevant, just that I'm then able to extrapolate a position at any given point in time. The input is [[lat,long],[lat,long]], from that, I need to continue along that line around the earth, and I'm completely hung up on how to do it. – Korvin Szanto Oct 2 '12 at 6:55