I have N
GPS coordinates with N
distances given to an unknown position which I wish to determine.
My first approach was to use just three p
To improve the accepted answer, one way to improve the SVD solution more is to account for the variation of the earth's radius by latitude; this particularly affects the altitude estimate, but it also has some knock-on effects on latitude and longitude. The "simple" solution would be to use the average value for R
, which according to Wikipedia is 6371008.8 m rather than 6378137 m.
A more accurate estimate would be to adjust R
for the latitude:
def EarthRadiusAtLatitude(lat):
rlat = np.deg2rad(lat)
a = np.float64(6378137.0)
b = np.float64(6356752.3)
rad = np.sqrt(((a*a*np.cos(rlat))**2 + (b*b*np.sin(rlat))**2) /
((a*np.cos(rlat))**2 + (b*np.sin(rlat))**2))
return rad
Then set R
based on the latitude of one of the initial points. Or, if you have a large variation in latitude, you could compute the SVD based on an estimate of R
and use the preliminary solution's latitude to solve using a closer estimate of R
.
After making this adjustment, in my experiments with both constructed examples and "real world" data based on LTE eNodeB timing advance values, the SVD solution typically is within one second of latitude and longitude except in some degenerate cases, which is fairly comparable to a solution based on iterative optimization (i.e. minimizing the distance residuals).