neic-glass3  1.4.6
geo.h
Go to the documentation of this file.
1 /*****************************************
2  * This file is documented for Doxygen.
3  * If you modify this file please update
4  * the comments so that Doxygen will still
5  * be able to work.
6  ****************************************/
7 #ifndef GEO_H
8 #define GEO_H
9 
10 #include <glassmath.h>
11 
12 namespace glass3 {
13 namespace util {
14 
25 class Geo {
26  public:
32  Geo();
33 
49  Geo(double lat, double lon, double rad, double cartX, double cartY,
50  double cartZ, double unitX, double unitY, double unitZ);
51 
59  explicit Geo(Geo *geo);
60 
66  virtual ~Geo();
67 
83  void initialize(double lat, double lon, double rad, double cartX,
84  double cartY, double cartZ, double unitX, double unitY,
85  double unitZ);
86 
94  virtual void clone(Geo *geo);
95 
99  void clear();
100 
112  virtual void setGeographic(double lat, double lon, double r);
113 
124  virtual void setGeocentric(double lat, double lon, double r);
125 
138  virtual void getGeographic(double *lat, double *lon, double *r);
139 
153  virtual void getGeocentric(double *lat, double *lon, double *r);
154 
166  virtual void setCartesian(double x, double y, double z);
167 
177  virtual double delta(Geo *geo);
178 
188  virtual double azimuth(Geo *geo);
189 
195 
201 
207 
213 
219 
225 
231 
237 
243 
244  // Geographic constants
248  static constexpr double k_EarthRadiusKm = 6371.0;
249 
254  static constexpr double k_DegreesToKm = 111.19;
255 
260  static constexpr double k_KmToDegrees = 0.00899;
261 
265  static constexpr double k_MaximumLatitude = 90.0;
266 
270  static constexpr double k_MinimumLatitude = -90.0;
271 
275  static constexpr double k_MaximumLongitude = 180.0;
276 
280  static constexpr double k_MinimumLongitude = -180.0;
281 
285  static constexpr double k_LongitudeWrap = 360.0;
286 
290  static constexpr double k_GeographicToGeocentric = 0.993277;
291 
295  static constexpr double k_dMetersToKm = 0.001;
296 
300  static constexpr double k_dElevationToDepth = -1.0;
301 };
302 } // namespace util
303 } // namespace glass3
304 #endif // GEO_H
double m_dGeocentricLongitude
the double value containing the geocentric longitude in degrees.
Definition: geo.h:200
virtual void getGeographic(double *lat, double *lon, double *r)
CGeo geographic coordinate get function.
Definition: geo.cpp:164
virtual double delta(Geo *geo)
Calculate the distance to a given CGeo object.
Definition: geo.cpp:203
double m_dUnitVectorX
the double value containing the x unit vector used in delta calculations
Definition: geo.h:230
virtual void setGeographic(double lat, double lon, double r)
CGeo geographic coordinate set function.
Definition: geo.cpp:72
double m_dCartesianY
the double value containing the Cartesian y coordinate.
Definition: geo.h:218
static constexpr double k_MaximumLatitude
Maximum possible latitude value.
Definition: geo.h:265
double m_dCartesianX
the double value containing the Cartesian x coordinate.
Definition: geo.h:212
double m_dCartesianZ
the double value containing the Cartesian z coordinate.
Definition: geo.h:224
geographic coordinate conversion class
Definition: geo.h:25
The neic-glass3 project namespace containing all the classes and functions that make up neic-glass3...
virtual void getGeocentric(double *lat, double *lon, double *r)
CGeo geographic coordinate get function.
Definition: geo.cpp:185
static constexpr double k_MinimumLongitude
Minimum possible longitude value.
Definition: geo.h:280
void initialize(double lat, double lon, double rad, double cartX, double cartY, double cartZ, double unitX, double unitY, double unitZ)
CGeo init method.
Definition: geo.cpp:57
void clear()
CGeo clear function.
Definition: geo.cpp:45
virtual void setCartesian(double x, double y, double z)
CGeo Cartesian coordinate set function.
Definition: geo.cpp:144
static constexpr double k_GeographicToGeocentric
Latitude geographic to geocentric conversion factor.
Definition: geo.h:290
virtual void clone(Geo *geo)
CGeo clone method.
Definition: geo.cpp:38
double m_dUnitVectorY
the double value containing the y unit vector used in delta calculations
Definition: geo.h:236
static constexpr double k_MinimumLatitude
Minimum possible latitude value.
Definition: geo.h:270
static constexpr double k_DegreesToKm
Degrees to Kilometers conversion factor based on 6371 as the average radius.
Definition: geo.h:254
static constexpr double k_dMetersToKm
The factor used to convert meters to kilometers.
Definition: geo.h:295
static constexpr double k_dElevationToDepth
The factor used to elevation to depth.
Definition: geo.h:300
static constexpr double k_KmToDegrees
Kilometers to Degrees conversion factor based on 6371 as the average radius.
Definition: geo.h:260
double m_dGeocentricLatitude
the double value containing the geocentric latitude in degrees.
Definition: geo.h:194
static constexpr double k_MaximumLongitude
Maximum possible longitude value.
Definition: geo.h:275
Geo()
CGeo constructor.
Definition: geo.cpp:20
double m_dGeocentricRadius
the double value containing the geocentric radius in kilometers.
Definition: geo.h:206
static constexpr double k_EarthRadiusKm
Average earth radius in kilometers.
Definition: geo.h:248
virtual double azimuth(Geo *geo)
Calculate the azimuth to a given CGeo object.
Definition: geo.cpp:220
double m_dUnitVectorZ
the double value containing the z unit vector used in delta calculations
Definition: geo.h:242
static constexpr double k_LongitudeWrap
Longitude wrap factor.
Definition: geo.h:285
virtual void setGeocentric(double lat, double lon, double r)
CGeo geocentric coordinate set function.
Definition: geo.cpp:110
virtual ~Geo()
CGeo destructor.
Definition: geo.cpp:35