FRGEOD.M
资源名称:easy.zip [点击查看]
上传用户:sfyaiting
上传日期:2009-10-25
资源大小:320k
文件大小:1k
源码类别:
GPS编程
开发平台:
Matlab
- 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 %%%%%%%%%%%%%%