calculate distance with latitude and longitude

24 ビュー (過去 30 日間)
ELISABETTA BILLOTTA
ELISABETTA BILLOTTA 2021 年 5 月 3 日
編集済み: William Rose 2021 年 5 月 3 日
i have some netcdf files. how do i calculate the distance between two points and between two areas within a grid having the latitude and longitude values?

採用された回答

William Rose
William Rose 2021 年 5 月 3 日
I assume you know the standard formula for distance betwen two points whose longitudes () and latitudes () are given.
where r is the Earth radius.
I don't know what you mean by "distance between two areas within a grid". Can you clarify, please?
  2 件のコメント
ELISABETTA BILLOTTA
ELISABETTA BILLOTTA 2021 年 5 月 3 日
the arccos function does not accept me and changes me by inserting acos. it's correct?
what unit of measurement is the result obtained? because I need to know the distance in km.
in the meantime, thank you very much for your reply.
William Rose
William Rose 2021 年 5 月 3 日
編集済み: William Rose 2021 年 5 月 3 日
@ELISABETTA BILLOTTA, Yes, inverse cosine is called acos() in Matlab.
The units of the answer will equal the units used for the radius of the sphere. To get the distance in km, use r=6371 km.
Remember to convert all latitudes and longitudes to radians before computing their sine or cosine.
The Earth is not really a sphere. It is approximately a flattened ellipsoid. The equatorial radius is about 0.3% larger than the polar radius. The radius value above is an average which gives a sphere with approximately the same surface area and volume as the real Earth.
A formula for distance between two points, that accounts for the Earth's ellipsoidal shape, is more complicated. The differences in distances between the spherical and ellipsoidal Earth models are less than 0.2% in the worst case, and usually a lot less than that. Therefore I would go with the formula above.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometric Geodesy についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by