How to convert arc length to km?

13 次查看(过去 30 天)
My goal is to find a good function to calculate the distance for two points for millions of data points. I found the fucntion lldistkm in the FileExchange. Unfortunately, that function does not seem to work well for column data. It only works well for single data points.
Lon1 = -78.1982;
Lat1 = 33.8282;
Lon2 = -77.5003;
Lat2 = 32.8499;
Distance_km = lldistkm([Lat1, Lon1],[Lat2, Lon2])
Distance_arc = distance(Lat1, Lon1, Lat2, Lon2)
Here is my question. If I will rely on the Matlab function distance (see above) in the mapping toolbox to calcualte the distance. It's results will be in arc length? How do I convert it from arc length to km? Their ratio should be around 111 depending on the latitude.
So rad2km is the wrong function? It does not give me a number close to 111 at all.
Many thanks.

采纳的回答

Sean de Wolski
Sean de Wolski 2021-4-11
Arc length from the distance function is the distance. It will be in units of the ellipsoid or the value of the fifth input argument:
https://www.mathworks.com/help/releases/R2021a/map/working-with-distances-on-the-sphere.html

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by