Code covered by the BSD License
-
Delta_R_Trop=Error_Tropospher...
This Function approximate Troposspheric Group Delay Base on
-
ECEF2GPS(Pos)
ECEF2LLA - convert earth-centered earth-fixed (ECEF)
-
XYZ2ENU(A,Phi,Lambda)
-
[Delta_I]=Error_Ionospheric_K...
This Function approximate Ionospheric Group Delay
-
[E,A]=Calc_Azimuth_Elevation(...
This Function Compute Azimuth and Elevation of satellite from reciever
-
[G,Delta_X,Pos_Rcv_n,B]=Gen_G...
This Function use Ephemeris Data and Calculate satellite Position
-
[Pos_xyz_Mat,Orbit_parameter]...
This Function use Ephemeris Data and Calculate satellite Position
-
d=Distance(Pos_SV,Pos_Rcv);
-
dTclk_Offset=Error_Satellite_...
This Function calculate Satellite Offest Clock Error Base on GPS Theory *
-
dTclk_Rel=Error_Satellite_Clo...
This Function calculate Satellite Clock Error Base on
-
f=Kepler_Eq(x,M,e)
-
plot_Orbit(Orbit_parameter,co...
This Function show the satellite and its orbit+Earth geometry
-
main.m
-
main_request.m
-
View all files
from
GPS Navigation Toolbox
by moein mehrtash
This program include
Principle of Radio Navigation Calculation and GPS position error corrections.
|
| ECEF2GPS(Pos)
|
% ECEF2LLA - convert earth-centered earth-fixed (ECEF)
% cartesian coordinates to latitude, longitude,
% and altitude
%
% USAGE:
% [lat,lon,alt] = ECEF2GPS(x,y,z)
%
% lat = geodetic latitude (radians)
% lon = longitude (radians)
% alt = height above WGS84 ellipsoid (m)
% x = ECEF X-coordinate (m)
% y = ECEF Y-coordinate (m)
% z = ECEF Z-coordinate (m)
%
% Notes: (1) This function assumes the WGS84 model.
% (2) Latitude is customary geodetic (not geocentric).
% (3) Inputs may be scalars, vectors, or matrices of the same
% size and shape. Outputs will have that same size and shape.
% (4) Tested but no warranty; use at your own risk.
% (5) Michael Kleder, April 2006
function GPS = ECEF2GPS(Pos)
x=Pos(1);
y=Pos(2);
z=Pos(3);
% WGS84 ellipsoid constants:
a = 6378137;
e = 8.1819190842622e-2;
% calculations:
b = sqrt(a^2*(1-e^2));
ep = sqrt((a^2-b^2)/b^2);
p = sqrt(x^2+y^2);
th = atan2(a*z,b*p);
lon = atan2(y,x);
lat = atan((z+ep^2*b*(sin(th))^3)/(p-e^2*a*(cos(th))^3));
N = a/sqrt(1-e^2*(sin(lat))^2);
alt = p/cos(lat)-N;
% correct for numerical instability in altitude near exact poles:
% (after this correction, error is about 2 millimeters, which is about
% the same as the numerical precision of the overall function)
k=abs(x)<1 & abs(y)<1;
alt(k) = abs(z(k))-b;
GPS=[lat,lon,alt];
return
|
|
Contact us