Calculate distance between two coordinates with depth
이전 댓글 표시
I need to do what's in the title. I saw a file exchange about calculating the distance between two coordinates, but how would i do it considering the altitude? I have my data in latitude and longitude so i would need something to convert it first, i saw online and doing it one by one would take to long
댓글 수: 2
Ameer Hamza
2018년 5월 30일
What do you mean by "considering the altitude". Give an example to clarify your question.
Feliciano Döring
2018년 5월 30일
편집: Feliciano Döring
2018년 5월 30일
채택된 답변
추가 답변 (1개)
Rob Comer
2022년 4월 29일
As Dr. Kearney suggested, the Mapping Toolbox can help. If you have it, try using ecefOffset. It computes the 3-D offset vector between two points (or, element-wise, between two sets of points), in an Earth-Centered Earth-Fixed (ECEF) coordinate system. From there, it's just a matter of computing the length of the offset vector to obtain the distance.
[deltaX,deltaY,deltaZ] = ecefOffset(spheroid,lat1,lon1,h1,lat2,lon2,h2);
d = hypot(hypot(deltaX,deltaY),deltaZ);
As the syntax suggests, the points need to be specified relative to a reference spheroid. (In many cases, wgs84ellipsoid will give an appropriate value.) The latitudes and longitudes need to be in degrees, and the height units need to match spheroid.LengthUnit. The h1 and h2 inputs should be heights above the ellipsoid, so if the available altitude values are referenced to something else (e.g., Mean Sea Level or Ground Level), they should be converted first using a geoid model and/or terrain model.
댓글 수: 1
Mohammed Alnaji
2024년 5월 31일
Hello,
How to convert barometric altitude (barometric pressure altitude above mean see level "AMSL") to heights above the ellipsoid using a geoid model, or other means, please?
Thank you,
카테고리
도움말 센터 및 File Exchange에서 Geometric Geodesy에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!