1 //==============================================================================
2 //
3 //  This file is part of GPSTk, the GPS Toolkit.
4 //
5 //  The GPSTk is free software; you can redistribute it and/or modify
6 //  it under the terms of the GNU Lesser General Public License as published
7 //  by the Free Software Foundation; either version 3.0 of the License, or
8 //  any later version.
9 //
10 //  The GPSTk is distributed in the hope that it will be useful,
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 //  GNU Lesser General Public License for more details.
14 //
15 //  You should have received a copy of the GNU Lesser General Public
16 //  License along with GPSTk; if not, write to the Free Software Foundation,
17 //  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 //  This software was developed by Applied Research Laboratories at the
20 //  University of Texas at Austin.
21 //  Copyright 2004-2020, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 //  This software was developed by Applied Research Laboratories at the
28 //  University of Texas at Austin, under contract to an agency or agencies
29 //  within the U.S. Department of Defense. The U.S. Government retains all
30 //  rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 //  Pursuant to DoD Directive 523024
33 //
34 //  DISTRIBUTION STATEMENT A: This software has been approved for public
35 //                            release, distribution is unlimited.
36 //
37 //==============================================================================
38 
39 /**
40  * @file PZ90Ellipsoid.hpp
41  * PZ90.02 model of the Ellipsoid (as defined in table 3.2 of ICD-2008, v5.1).
42  */
43 
44 #ifndef GPSTK_PZ90ELLIPSOID_HPP
45 #define GPSTK_PZ90ELLIPSOID_HPP
46 
47 #include "EllipsoidModel.hpp"
48 
49 namespace gpstk
50 {
51       /// @ingroup Geodetic
52       //@{
53 
54    class PZ90Ellipsoid : public EllipsoidModel
55    {
56    public:
57 
58          ///Defined in table 3.2 of ICD-2008 (v5.1)
59          /// @return semi-major axis of Earth in meters.
a() const60       virtual double a() const throw()
61       { return 6378136.0; }
62 
63          ///Defined in table 3.2 of ICD-2008 (v5.1)
64          /// @return semi-major axis of Earth in km.
a_km() const65       virtual double a_km() const throw()
66       { return a() / 1000.0; }
67 
68          /**
69           * Defined in table 3.2 of the GLONASS ICD-2008 (v5.1)
70           * @return inverse o flattening (ellipsoid parameter).
71           */
flatteningInverse() const72       virtual double flatteningInverse() const throw()
73       { return 298.25784; }
74 
75          /**
76           * Computed from inverse flattening value as given in table 3.2
77           * of the GLONASS ICD-2008 (v5.1)
78           * @return flattening (ellipsoid parameter).
79           */
flattening() const80       virtual double flattening() const throw()
81       { return 3.35280373518e-3; }
82 
83          // The eccentricity and eccSquared values were computed from the
84          // flattening value via the formula:
85          // ecc2 = 1 - (1 - f)^2 = f*(2.0 - f)
86          // ecc = sqrt(ecc2)
87          /// @return eccentricity (ellipsoid parameter).
eccentricity() const88       virtual double eccentricity() const throw()
89       { return 8.1819106432923e-2; }
90 
91          /// @return eccentricity squared (ellipsoid parameter).
eccSquared() const92       virtual double eccSquared() const throw()
93       { return 6.69436617748e-3; }
94 
95          ///Defined in table 3.2 of ICD-2008 (v5.1)
96          /// @return angular velocity of Earth in radians/sec.
angVelocity() const97       virtual double angVelocity() const throw()
98       { return 7.292115e-5; }
99 
100          ///Defined in table 3.2 of ICD-2008 (v5.1)
101          /// @return geocentric gravitational constant in m**3 / s**2
gm() const102       virtual double gm() const throw()
103       { return 398600.4418e9; }
104 
105          ///Defined in table 3.2 of ICD-2008 (v5.1)
106          /// @return geocentric gravitational constant in km**3 / s**2
gm_km() const107       virtual double gm_km() const throw()
108       { return 398600.4418; }
109 
110          ///Defined in table 3.2 of ICD-2008 (v5.1)
111          /// @return Speed of light in m/s.
c() const112       virtual double c() const throw()
113       { return 299792458; }
114 
115          ///Defined in table 3.2 of ICD-2008 (v5.1)
116          /// @return Speed of light in km/s
c_km() const117       virtual double c_km() const throw()
118       { return c()/1000.0; }
119 
120          ///Defined in table 3.2 of ICD-2008 (v5.1)
121          /// @return Returns second zonal harmonic of the geopotential.
j20() const122       virtual double j20() const throw()
123       { return (-1.08262575e-3); }
124 
125          /// Destructor.
~PZ90Ellipsoid()126       virtual ~PZ90Ellipsoid() throw() {};
127 
128    }; // End of class 'PZ90Ellipsoid'
129 
130       //@}
131 
132 }  // End of namespace gpstk
133 
134 #endif   // GPSTK_PZ90ELLIPSOID_HPP
135