frgeod.m

来自「GPS导航电文相关的计算程序」· M 代码 · 共 31 行

M
31
字号
function [X,Y,Z] = frgeod(a,finv,dphi,dlambda,h)
%FRGEOD  Subroutine to calculate Cartesian coordinates X,Y,Z
%	      given geodetic coordinates latitude, longitude (east),
%	      and height above reference ellipsoid along with
%	      reference ellipsoid values semi-major axis (a) and
%	      the inverse of flattening (finv)

% The units of linear parameters h,a must agree (m,km,mi,..etc).
% The input units of angular quantities must be in decimal degrees.
% The output units of X,Y,Z will be the same as the units of h and a.

% Copyright (C) 1987 C. Goad, Columbus, Ohio
% Reprinted with permission of author, 1996
% Original Fortran code rewritten into MATLAB
% Kai Borre 03-03-96

% compute degree-to-radian factor
dtr = pi/180;
% compute square of eccentricity
esq = (2-1/finv)/finv;
sinphi = sin(dphi*dtr);
% compute radius of curvature in prime vertical
N_phi = a/sqrt(1-esq*sinphi*sinphi);
% compute P and Z
% P is distance from Z axis
P = (N_phi + h)*cos(dphi*dtr);
Z = (N_phi*(1-esq) + h) * sinphi;
X = P*cos(dlambda*dtr);
Y = P*sin(dlambda*dtr);
%%%%%%% end frgeod.m %%%%%%%%%%%%%%

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?