I am working on a problem involving calculating the distance between two GPS coordinates. I can calculate the distance, d, between the points, and I want to calculate the uncertainty in that distance given the uncertainty in the GPS coordinates.
I am using the Haversine equations to calculate the distance. Using some calculus and algebra (see attached images) I derived an expression for the uncertainty in the distance, given the uncertainty in the two GPS coordinates.
I then set out a baseline of 200 feet (measured with a tape) and took two sets of GPS coordinates at each end of the baseline using my phone. The uncertainty in the GPS measurements was 3 m (68% confidence interval).
I wrote a small Java program to calculate the distance between the points and the uncertainties from the attached derived formulas. This is what I get:
As you can see I have a huge disparity between the calculated uncertainty in the distance and the observed uncertainty (or error) in the distance calculation. I have checked both the calculations and the program, and they agree with each other and I can't find an error in the math.
I hope someone can point out where I made a mistake in the derivation of the formula for the uncertainty in the distance calculation!
Thanks,
Mark
I am using the Haversine equations to calculate the distance. Using some calculus and algebra (see attached images) I derived an expression for the uncertainty in the distance, given the uncertainty in the two GPS coordinates.
I then set out a baseline of 200 feet (measured with a tape) and took two sets of GPS coordinates at each end of the baseline using my phone. The uncertainty in the GPS measurements was 3 m (68% confidence interval).
I wrote a small Java program to calculate the distance between the points and the uncertainties from the attached derived formulas. This is what I get:
Code:
Calculating parameters for points (33.49659, -111.94663), and (33.49645, -111.94726).
a = 2.2512200743211597E-11
c = 9.489404774458836E-6
delta_x_squared = 2.686725642030647E-11
delta_y_squared = 2.5534163100976264E-22
delta_a_squared = 2.686725642056181E-11
delta_c_squared = 1.1934531291556776
distance = 198.571 calculated uncertainty = 22860148.391 measured uncertainty = 1.429
Calculating parameters for points (33.49656666, -111.94661348), and (33.49644314, -111.94726209).
a = 2.344164935090917E-11
c = 9.683315413863653E-6
delta_x_squared = 2.0914226880126016E-11
delta_y_squared = 2.706500505494784E-22
delta_a_squared = 2.0914226880396665E-11
delta_c_squared = 0.8921823958635309
calculated distance = 202.628 calculated uncertainty = 19765289.796 measured uncertainty = -2.628
As you can see I have a huge disparity between the calculated uncertainty in the distance and the observed uncertainty (or error) in the distance calculation. I have checked both the calculations and the program, and they agree with each other and I can't find an error in the math.
I hope someone can point out where I made a mistake in the derivation of the formula for the uncertainty in the distance calculation!
Thanks,
Mark