So I've been doing a lot of searching and haven't found exactly what I'm looking for. My math skills are a bit rusty, so I haven't had luck deriving this on my own.
What I'm looking for is an equation (or set of equations) where I can plug in starting and ending spherical coordinates, plus a percentage (ie [0,1]) and output spherical coordinates of some point in between (ie, progress along a great circle).
The idea is basically to chart the progress of a plane between two cities and draw it on a globe or map.
Inputs:
- lat1,lon1
- lat2,lon2
- r (radius)
- p (progress, from 0->1)
Output:
- lat_x,lon_x (point in-between)
Ok, so I found what I was looking for at Ed Williams' awesome Aviation Formulary:
Given (lat1,lon1), (lat2,lon2), and progress fraction f=[0,1]
d = acos(sin(lat1) * sin(lat2) + cos(lat1) * cos(lat2) * cos(lon1 - lon2))
A = sin((1 - f) * d) / sin(d)
B = sin(f * d) / sin(d)
x = A * cos(lat1) * cos(lon1) + B * cos(lat2) * cos(lon2)
y = A * cos(lat1) * sin(lon1) + B * cos(lat2) * sin(lon2)
z = A * sin(lat1) + B * sin(lat2)
lat_f = atan2(z, sqrt(x^2 + y^2))
lon_f = atan2(y,x)