필터 지우기
필터 지우기

How to convert latitude and longitude of location to cartesian coordinates (x, y)?

조회 수: 50 (최근 30일)
Dear Sir,
Is there a feasible way of converting (lat, long) coordinates into cartesian corordinates (x, y) of respective locations?
For instance, i want to convert (27.2046° N, 77.4977° E) coordinates into (x, y).

채택된 답변

Chunru
Chunru 2022년 8월 15일
First, you need a reference point. Second you have to assume that the posints are close enough to the reference points so that the spherical coordinates on earth surface (lat, lon) can be approximate in cartesian coordinates.
With these assumption, you can do the following:
ref = [27, 77]; % ref point [lat, lon]
p = [27.2046, 77.4977];
[arclen az] = distance(ref, p)
arclen = 0.4880
az = 65.0993
x = deg2km(arclen.*cosd(az));
y = deg2km(arclen.*sind(az));
[x, y]
ans = 1×2
22.8478 49.2198
  댓글 수: 2
ANURAG DEEPAK
ANURAG DEEPAK 2022년 8월 16일
How is distance (ref, p) function defined? And, how can i choose reference point for the very first point in the dataset?
Chunru
Chunru 2022년 8월 16일
"doc distance" for more details.
You can use the center of of data points as the reference point.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Map Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by