plh2xyzwgs.m
来自「In the planning stage of a GNSS-measurem」· M 代码 · 共 34 行
M
34 行
function xyz = plh2xyzwgs(plh)
%PLH2XYZWGS Ellipsoidal coordinates to Cartesian Coordinates
% Converts ellipsoidal coordinates Phi, Lambda and h into
% cartesian coordinates X, Y and Z:
%
% xyz = plh2xyzwgs(plh)
%
% Ellips is WGS-84.
% Based on plh2xyz.m written by
% H. van der Marel, LGR, 07-05-95
% (c) Geodetic Computing Centre, TU Delft
a=6378137.;
f=1/298.257223563;
% excentricity e (squared)
e2 = 2*f - f^2;
[m,n]=size(plh);
if n~=3 & m==3, plh=plh';, end
N = a ./ sqrt(1 - e2 .* sin(plh(:,1)).^2);
xyz = [ (N+plh(:,3)).*cos(plh(:,1)).*cos(plh(:,2)) ...
(N+plh(:,3)).*cos(plh(:,1)).*sin(plh(:,2)) ...
(N-e2.*N+plh(:,3)).*sin(plh(:,1)) ];
if n~=3 & m==3, xyz=xyz';, end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?