geometry
geometry copied to clipboard
large distance errors appearing in the short-range case by Andoyer and Thomas formulas
Hello, The Boost Geometry's distance calculations by Andoyer and Thomas formulas seem to induce large errors in the short-range case, as shown in Figure 1. The maximum absolute distance error as a function of distance. in GEODESIC ALGORITHMS: AN EXPERIMENTAL STUDY by Vissarion Fisikopoulos (2019).
I think they should use law of haversines formula for distance (i.e., d = 2 * asin(sin_d_half)) for accuracy, instead of spherical law of cosines (i.e., d = acos(cos_d)). Thank you.
Hello, I will add data set for testing accuracy by using GeodSolve:
#!/bin/sh
step=1 # in degree
dist_max=19970000 # in meter
for dist_exponent in $(seq 0 7); do
for dist_significand in 1 3; do
dist=$((10 ** dist_exponent * dist_significand))
[ $dist -gt $dist_max ] && dist=$dist_max
for dir in $(seq 0 $step 90); do
for lat in $(seq -90 $step 90); do
echo $lat 0 $dir $dist | sh -c 'w="$(cat)"; /bin/echo -n "$w "; GeodSolve -p 9 --input-string "$w"' | awk '{print $1,$2,$3,$5,$6,$7,$4}'
done
done
done
done
The following is an accuracy test using haversine (and above data set):
The following compares Andoyer formula using haversine with that using cosine law:
If I understand that paper right, it includes the haversine formula in the comparison under the label "spherical" and it produces orders of magnitude larger errors for every maximum distance except 2 meters.
Thanks for opening this issue and for the computations. Indeed, it seems a good idea to replace d = acos(cos_d)) by 2 * asin(sin_d_half)) in andoyer and thomas formulas.
I missed the calculation for Andoyer formula in above chart. I calculated, instead, the result of Andoyer-Lambert one, which uses parametric latitude.
I missed the calculation for Andoyer formula in above chart. I calculated, instead, the result of Andoyer-Lambert one, which uses parametric latitude.
Could you please provide the details of how you generated the plots above. I thought you were using the boost geometry's formulas.
I'm using the equivalents of the boost geometry's formulas for the plots above. I'm now struggling against my disordered status about these, however. So please be patient for a while. Thank you.
I've just updated https://github.com/kkdd/geodistance-js for providing the benchmarks and plots of formulas. Its minimum deployment is provided in https://kkdd.github.io/geodistance-js: