forked from jainam-bhavasar/CE678_PROJECT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_Ellipsoid.m
50 lines (48 loc) · 1.69 KB
/
make_Ellipsoid.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
%----------------------------------------------------------------------------
% get_Ellipsoid(ellipType) returns a structure containing ellipsoid
% parameters for the 'WGS84' and the 'GRS80' ellipsoids.
%
% Input:
% ellipType (string) Accepts 'WGS84' or 'GRS80'
%
% Output: ellipsoid (Struct)
% fields: GM (double) Earth's Gravitational Constant(m^3/s^2)
% omega (double) Angular Velocity of Earth (rad/s)
% gammaEquator (double) Equatorial Normal Gravity (mGal)
% gammaPole (double) Polar Normal Gravity (mGal)
% a (double) Semi-major Axis (m)
% b (double) Semi-minor Axis (m)
% e (double) first eccentricy (unitless)
% e2 (double) first ecentricity squared (unitless)
% f (double) flattening (unitless)
%
function [ellipsoid] = make_Ellipsoid(ellipType)
switch ellipType
case 'WGS84'
ellipsoid.GM = 3986004.418E8;
ellipsoid.omega = 7.292115e-5;
ellipsoid.gammaEquator = 978032.53359;
ellipsoid.gammaPole = 983218.49378;
ellipsoid.a = 6378137.0;
ellipsoid.b = 6356752.3142;
ellipsoid.e = 8.1819190842622.*1E-2; %first eccentricity
ellipsoid.e2 = 6.69437999014.*1E-3; %first eccentricity squared
ellipsoid.f = 1/298.257223563; %flattening
%WGS84 defining parameters from NIMA (2004).
case 'GRS80'
ellipsoid.GM=3986005E8;
ellipsoid.omega=7.292115e-5;
ellipsoid.gammaEquator=978032.67715;
ellipsoid.gammaPole = 983218.63685;
ellipsoid.a = 6378137;
ellipsoid.b = 6356752.3142;
ellipsoid.e = 0.081819190842622; %first eccentricity
ellipsoid.e2 = 0.00669437999014; %first eccentricity squared
ellipsoid.f = 0.00335281066474; %flattening
%GRS80 defining parameters from Moritz (2000).
otherwise
warning('This ellipsoid is not supported')
return
end
end
%------------------------------------------------------