ECEF(X,Y,Z) to Longitude and Latitude.

버전 1.0.0 (1.57 KB) 작성자: Minjae Yoo
Convert coordinate from ECEF(X,Y,Z) to Longitude and Latitude.
다운로드 수: 252
업데이트 날짜: 2018/11/25

라이선스 보기

clc;

% !!! This code following WGS84 Model !!!;
% Define X, Y, Z samples that have Latitude 50; Longitude 100; Height 200M;
% http://www.apsalin.com/convert-geodetic-to-cartesian.aspx
X = -713345.437320888;
Y = +4045583.0097852;
Z = +4862942.24652593;

% Estimate radius of curvature;
a = 6378137; % Meter; % Semi-major axis;
f = 1/298.257223563; % Ellipsoid flattening;
b = a*(1-f); % Define Semi-minor axis;

% Estimate auxiliary values;
P = sqrt(X^2 + Y^2);
Theta = atan(Z*a/P*b);
e = sqrt(((a^2) - (b^2))/a^2); % First eccentricity of The Earth;
e2 = sqrt((a^2 - b^2)/b^2); % Second eccentricity of The Earth;

% Initial value of Latitude;
ppi = atan2(Z,(P*(1-e^2)));

% Iteration loop for estimate Latitude(ppi);
for i = 1:10000
N = a / sqrt(1-e^2*sin(ppi).^2); % Prime vertical;
h = (P/cos(ppi)) - N; % Height;
ppi = atan2(Z,(P*(1-e^2*(N/(N+h))))); % Latitude
end

lamda = (atan2(Y,X))*180/pi;
ppi = ppi*180/pi;

% Display results
disp('Longitutde is :');
disp(lamda);
disp('Latitude is :');
disp(ppi);
disp('Height(Meter) is :');
disp(h);

인용 양식

Minjae Yoo (2024). ECEF(X,Y,Z) to Longitude and Latitude. (https://www.mathworks.com/matlabcentral/fileexchange/69514-ecef-x-y-z-to-longitude-and-latitude), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2018b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0