How to convert arc length to km?

13 visualizaciones (últimos 30 días)
Leon
Leon el 11 de Abr. de 2021
Comentada: Leon el 11 de Abr. de 2021
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.

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 11 de Abr. de 2021
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
  1 comentario
Leon
Leon el 11 de Abr. de 2021
It works! That's exactly what I want.
Many thanks.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Resizing and Reshaping Matrices en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by