Interpolating GPS coordinates I can't profess to being a hardcore mathematician, I'm a computer scientist by nature, so please take it easy on me! There are a couple of similar questions on this, however, none seem to discuss the matter when we want to assume the earth is spherical.
I've got two lattitude/longitude points that are any distance upto ~100km apart. I need to add additional points roughly every 100m (which will be automated once I understand the maths).
I can hapily find the midpoint (where my mathematical knowledge runs out), however in data processing terms this is too processor intesive (to find the midpoint several times), so is there a formula that someone can derive/recite  that will calculate a point on the curve between two GPS points that is a set distance away (say 100m)?
Thanks for your help.
 A: For absolutely best accuracy (millimeter) you would need to first use the Vincenty direct method on the WGS84 ellipsoid to get the direction and distance, then repeatedly use Vincenty's indirect method to find the intermediate points at the exact intervals you want.  This is probably too expensive for you.
The next best method would be to calculate the ECEF (x,y,z) for the starting and ending points in your track, linearly interpolate between them, then convert each point back to latitude and longitude.  This would cost you basically 2 inverse trig functions per interpolated point.  If you use a spherical approximation for the earth then you will be off by as much as a foot or two, and if you use WGS84 it will be harder to calculate and your interval spacing would vary only by a couple of inches.  
The next best method would be to figure out the distance between the points, then just linearly interpolate over the latitude and longitude between them.  This would take special handling around the international date line, and would embarrassingly fail near the poles.  However, it would be fine over most populated areas and would be very cheep.
A: The simplest is to interpolate linearly in angle.  If you have points $(a,b)$ and $(c,d)$ and want $n$ intervals (so $n-1$) intervening points), your points are $(a+\frac in(c-a),b+\frac in(d-b))$ for $i=1,2,3\dots n-1$  This will not follow a great circle, nor be exactly evenly spaced, but will be smooth and involves not a single trig call.  The errors in the interpolation decrease as the step length gets shorter.  $100$ km is only $\frac 1{64}$ radius, so that is pretty small.
Alternately, you can do the midpoint calculation a few times, then do linear interpolation.  That gets you shorter steps at the price of more computation 
A: Aloha BrownE,
Here's the best solution I can think of.  You have the latitude $\phi$ and longitude $\lambda$ for each of the two endpoints, Point 1 and Point 2.  From that you could find the distance $D$ and direction (or heading, or azimuth) $Z$ to get from Point 1 to Point 2.  Finding these in geodesy or spherical trigonometry is sometimes called the "inverse problem".
Once you have the distance $D$ and especially the direction $Z$ to go from Point 1 to Point 2, you can turn around and solve the "direct problem" with a new distance $d$ of 100 km.  Knowing Point 1, and knowing the direction $Z$ you want to travel, and $d = 100$ km, then find the new point you will end up at.  Let's call that Point a.
Then repeat this for $d = 200$ km away from your original Point 1 to get to Point b, at the same direction $Z$ from Point 1.  Then repeat for $d = 300$ km, etc.  To visualize them, first is Point 1, 100 km away from that is Point a, 100 km away from that is Point b, etc. all the way to Point 2.
Be careful: You need to keep finding the new in-between points as measured from your Point 1.  The direction you are traveling along a great circle can change!  To see that, get on Google Earth and use the ruler tool to find the distance from Bergen, Norway to Anchorage, Alaska.  The direction you are traveling is gradually changing the entire time!
The best way to get the distance $D$ is from the haversine formula, a version of the spherical law of cosines that works better for short distances $D$.
$\sin^2{\frac{D}{2}} = \sin^2{\frac{\phi_2-\phi_1}{2}} + \cos{\phi_2}*cos{\phi_1}*\sin^2{\frac{\lambda_2-\lambda_1}{2}}$
Then get the direction $Z$ from the cotangent formula:
$\cot{Z} = \frac{\cos{\phi_1}*\tan{\phi_2}-\sin{\phi_1}*\cos{(\lambda_2-\lambda_1)}}{\sin{\lambda_2-\lambda_1}}$
Messy, but you only have to solve these two equations one time each.
Now you know, from Point 1, the direction $Z$ to get to all the intermediate points.  And you know their distances $d$ from Point 1: 100 km, 200 km, etc.  So now we do the opposite "direct problem" to find an unknown Point x's latitude $\phi_x$ and $\lambda_x$.
$\sin{\phi_x} = \sin{phi_1}*\cos{d}+\cos{phi_1}*\sin{d}*\cos{Z}$
$\tan{(\lambda_x - \lambda_1)} = \frac{\sin{Z}*sin{d}*cos{\phi_1}}{\cos{d}-\sin{\phi_1}*\sin{\phi_2}}$
Use the Z you found in the first part to plug in here.  Replace $d$ with 100 km, 200 km, etc. all the way up to the $D$ you found at the beginning.  And just repeat this for however many points you want.
