What method is used by the mapping toolbox to determine geodesic distances between points within various geodetic reference frames?

4 次查看(过去 30 天)
I have a radar tracking problem wherin I need to calculate the distance between two points.
While pursuing the answer to this problem I have encountered several methods to acomplish this task.
  1. The Vincenty formula was a commonly referenced solution to this problem. It has also been made into a few different Matlab libraries. Michael Kleder and themaze are two users that I found having impletmented the same Vincenty method.
  2. Charles Karney published on this topic in 2012 claiming to have a method that can take advantage of the computational power of modern computers. Additionally, this new method improves on the Vincenty method in terms of accuracy and ability to find a solution for points that are nearly antipodal. Karney has also posted a library of functions to accomplish this in matlab.
  3. There are several built-in functions in the Mapping Toolbox, such as geodetic2aer or distance, which return the measure of distance between the two inputted points.
There appear to be no references for the mapping toolbox functions which detail what methods are used to calculate these distances. Does anybody know what method the mapping toolbox uses to calculate these things? How accurate is the method matlab uses? Should I opt for the user uploaded methods instead of built-in functions?
The documentation for the distance() function in matlab describes a decrease in accuracy as the distance between points increases and the documentation warns of calculation breakdown for antipodal points. This suggests that the Vincenty formulas was used but it isn't directly said. Any insight is helpful here.

采纳的回答

Jack
Jack 2025-5-8
Under the hood, the Mapping Toolbox’s distance (and the related geodetic functions) solve the “inverse geodesic” problem on the reference ellipsoid using the classic Vincenty algorithm. When you supply a sphere, it simply falls back to the great‐circle formula.
Key points:
  • Ellipsoid mode: Vincenty’s inverse formula (1975)—accurate to a few tenths of a millimeter over most distances but known to fail or stall for nearly antipodal points.
  • Sphere mode: Standard spherical law of cosines or haversine.
Because it really is Vincenty’s routine, you will see the documentation’s warning about degrading accuracy at long distances and breakdown at antipodes. Karney’s 2012 “modern” algorithm (available via his MATLAB file exchange code) fixes those edge‐cases and is numerically more robust, but the built-in Mapping Toolbox hasn’t switched over to it.
If you need guaranteed convergence for any two lat/lon pairs, you should plug in Karney’s routines (or another robust inverse‐geodesic solver) instead of relying on distance(). For most everyday use within a few thousand kilometers, the toolbox’s Vincenty‐based distance() is perfectly adequate.
— Follow me so you can message me anytime with future questions. If this helps, please accept the answer and upvote it as well.
  6 个评论
Steve K
Steve K 2025-5-15
We had some labeling problems facepalm
Turns out that a slant range was labeled as ground range in one of our tools. They agree now.
I appreciate the help, at least I've learned a good deal about the back end of both packages now.
Are there any common tripping points I need to consider when converting from LLA to ECEF? I know there are a few methods to do the conversions, checking the wiki at least. I also read a paper published by Olson which suggested that the accuracy difference between methods was on the order of 10^-9m, so I do not think worrying about this is really worth the brain power.
Jack
Jack 2025-5-15
编辑:Jack 2025-5-15
You're right that the different methods generally yield very high accuracy (typically not worth the brain power 🙂‍↕️). However, here are a few common things to be on the lookout for:
  • Ellipsoid Parameters: Ensuring both systems are using the exact same ellipsoid definition (semi-major axis, flattening) is crucial.
  • Units
  • Latitude/Longitude Order
  • Sign Conventions
  • Numerical Precision: Differences in floating-point precision across different platforms or libraries could theoretically lead to extremely small variations in results, though this is unlikely to be the cause of a 200m difference.
In conclusion, given that you've resolved the labeling issue and the Olson paper suggests negligible accuracy differences between LLA to ECEF conversion methods, it's likely that ensuring consistent ellipsoid parameters and input units/order will be the most important factors for you to manage.

请先登录,再进行评论。

更多回答(0 个)

产品


版本

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by