neic-glass3  1.4.6
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
glass3::util::Geo Class Reference

geographic coordinate conversion class More...

#include <geo.h>

Collaboration diagram for glass3::util::Geo:
Collaboration graph

Public Member Functions

 Geo ()
 CGeo constructor. More...
 
 Geo (double lat, double lon, double rad, double cartX, double cartY, double cartZ, double unitX, double unitY, double unitZ)
 CGeo alternate constructor. More...
 
 Geo (Geo *geo)
 CGeo copy constructor. More...
 
virtual ~Geo ()
 CGeo destructor. More...
 
void initialize (double lat, double lon, double rad, double cartX, double cartY, double cartZ, double unitX, double unitY, double unitZ)
 CGeo init method. More...
 
virtual void clone (Geo *geo)
 CGeo clone method. More...
 
void clear ()
 CGeo clear function. More...
 
virtual void setGeographic (double lat, double lon, double r)
 CGeo geographic coordinate set function. More...
 
virtual void setGeocentric (double lat, double lon, double r)
 CGeo geocentric coordinate set function. More...
 
virtual void getGeographic (double *lat, double *lon, double *r)
 CGeo geographic coordinate get function. More...
 
virtual void getGeocentric (double *lat, double *lon, double *r)
 CGeo geographic coordinate get function. More...
 
virtual void setCartesian (double x, double y, double z)
 CGeo Cartesian coordinate set function. More...
 
virtual double delta (Geo *geo)
 Calculate the distance to a given CGeo object. More...
 
virtual double azimuth (Geo *geo)
 Calculate the azimuth to a given CGeo object. More...
 

Public Attributes

double m_dGeocentricLatitude
 the double value containing the geocentric latitude in degrees. More...
 
double m_dGeocentricLongitude
 the double value containing the geocentric longitude in degrees. More...
 
double m_dGeocentricRadius
 the double value containing the geocentric radius in kilometers. More...
 
double m_dCartesianX
 the double value containing the Cartesian x coordinate. More...
 
double m_dCartesianY
 the double value containing the Cartesian y coordinate. More...
 
double m_dCartesianZ
 the double value containing the Cartesian z coordinate. More...
 
double m_dUnitVectorX
 the double value containing the x unit vector used in delta calculations More...
 
double m_dUnitVectorY
 the double value containing the y unit vector used in delta calculations More...
 
double m_dUnitVectorZ
 the double value containing the z unit vector used in delta calculations More...
 

Static Public Attributes

static constexpr double k_EarthRadiusKm = 6371.0
 Average earth radius in kilometers. More...
 
static constexpr double k_DegreesToKm = 111.19
 Degrees to Kilometers conversion factor based on 6371 as the average radius. More...
 
static constexpr double k_KmToDegrees = 0.00899
 Kilometers to Degrees conversion factor based on 6371 as the average radius. More...
 
static constexpr double k_MaximumLatitude = 90.0
 Maximum possible latitude value. More...
 
static constexpr double k_MinimumLatitude = -90.0
 Minimum possible latitude value. More...
 
static constexpr double k_MaximumLongitude = 180.0
 Maximum possible longitude value. More...
 
static constexpr double k_MinimumLongitude = -180.0
 Minimum possible longitude value. More...
 
static constexpr double k_LongitudeWrap = 360.0
 Longitude wrap factor. More...
 
static constexpr double k_GeographicToGeocentric = 0.993277
 Latitude geographic to geocentric conversion factor. More...
 
static constexpr double k_dMetersToKm = 0.001
 The factor used to convert meters to kilometers. More...
 
static constexpr double k_dElevationToDepth = -1.0
 The factor used to elevation to depth. More...
 

Detailed Description

geographic coordinate conversion class

The CGeo class is a class that encapsulates the logic necessary to convert geographic, geocentric, and Cartesian coordinates to geographic and geocentric coordinates. The class also computes the distance and azimuth between coordinates, and intersections between geographic (or geocentric) spheres.

Constructor & Destructor Documentation

glass3::util::Geo::Geo ( )

CGeo constructor.

The constructor for the CGeo class.

glass3::util::Geo::Geo ( double  lat,
double  lon,
double  rad,
double  cartX,
double  cartY,
double  cartZ,
double  unitX,
double  unitY,
double  unitZ 
)

CGeo alternate constructor.

The atlernate constructor for the CGeo class.

Parameters
lat- The geocentric latitude in degrees
lon- The geocentric longitude in degrees
rad- The geocentric radius in kilometers
cartX- The Cartesian x coordinate.
cartY- The Cartesian y coordinate.
cartZ- The Cartesian z coordinate.
unitX- The x unit vector
unitY- The y unit vector
unitZ- The z unit vector
glass3::util::Geo::Geo ( Geo geo)
explicit

CGeo copy constructor.

The copy constructor for the CGeo class.

Parameters
geo- A pointer to a CGeo object to copy from
glass3::util::Geo::~Geo ( )
virtual

CGeo destructor.

The destructor for the CGeo class.

Member Function Documentation

double glass3::util::Geo::azimuth ( Geo geo)
virtual

Calculate the azimuth to a given CGeo object.

Computes the azimuth in radians from this object to a given CGeo object

Parameters
geo- A pointer to the CGeo object to calculate azimuth to
Returns
Returns the azimuth in radians between the two CGeo objects.
void glass3::util::Geo::clear ( )

CGeo clear function.

void glass3::util::Geo::clone ( Geo geo)
virtual

CGeo clone method.

The clone method for the CGeo class.

Parameters
geo- A pointer to a CGeo object to clone from
double glass3::util::Geo::delta ( Geo geo)
virtual

Calculate the distance to a given CGeo object.

Computes the distance in radians from this object to a given CGeo object

Parameters
geo- A pointer to the CGeo object to calculate distance to
Returns
Returns the distance in radians between the two CGeo objects.
void glass3::util::Geo::getGeocentric ( double *  lat,
double *  lon,
double *  r 
)
virtual

CGeo geographic coordinate get function.

Gets the current geographic coordinates from CGeo. NOTE: Does not appear to be called by glassutil or glasscore!

Parameters
lat- A pointer to the geographic latitude variable to populate in degrees
lon- A pointer to the geographic longitude variable to populate in degrees
r- A pointer to the geographic radius variable to populate in kilometers
void glass3::util::Geo::getGeographic ( double *  lat,
double *  lon,
double *  r 
)
virtual

CGeo geographic coordinate get function.

Gets the current geographic coordinates from CGeo

Parameters
lat- A pointer to the geographic latitude variable to populate in degrees
lon- A pointer to the geographic longitude variable to populate in degrees
r- A pointer to the geographic radius variable to populate in kilometers
void glass3::util::Geo::initialize ( double  lat,
double  lon,
double  rad,
double  cartX,
double  cartY,
double  cartZ,
double  unitX,
double  unitY,
double  unitZ 
)

CGeo init method.

The initialize method for the CGeo class.

Parameters
lat- The geocentric latitude in degrees
lon- The geocentric longitude in degrees
rad- The geocentric radius in kilometers
cartX- The Cartesian x coordinate.
cartY- The Cartesian y coordinate.
cartZ- The Cartesian z coordinate.
unitX- The x unit vector
unitY- The y unit vector
unitZ- The z unit vector
void glass3::util::Geo::setCartesian ( double  x,
double  y,
double  z 
)
virtual

CGeo Cartesian coordinate set function.

Sets CGeo to the provided Cartesian coordinates. Computes the geocentric coordinates and unit vectors. NOTE: Does not appear to be called by glassutil or glasscore!

Parameters
x- The Cartesian x coordinate
y- The Cartesian y coordinate
z- The Cartesian z coordinate
void glass3::util::Geo::setGeocentric ( double  lat,
double  lon,
double  r 
)
virtual

CGeo geocentric coordinate set function.

Sets CGeo to the provided geocentric coordinates. Computes the Cartesian coordinates and unit vectors.

Parameters
lat- The geocentric latitude in degrees
lon- The geocentric longitude in degrees
r- The geocentric radius in kilometers
void glass3::util::Geo::setGeographic ( double  lat,
double  lon,
double  r 
)
virtual

CGeo geographic coordinate set function.

Converts geographic coordinates into geocentric coordinates and sets CGeo to those geocentric coordinates. Computes the Cartesian coordinates and unit vectors.

Parameters
lat- The geographic latitude in degrees
lon- The geographic longitude in degrees
r- The geographic radius in kilometers

Member Data Documentation

constexpr double glass3::util::Geo::k_DegreesToKm = 111.19
static

Degrees to Kilometers conversion factor based on 6371 as the average radius.

constexpr double glass3::util::Geo::k_dElevationToDepth = -1.0
static

The factor used to elevation to depth.

constexpr double glass3::util::Geo::k_dMetersToKm = 0.001
static

The factor used to convert meters to kilometers.

constexpr double glass3::util::Geo::k_EarthRadiusKm = 6371.0
static

Average earth radius in kilometers.

constexpr double glass3::util::Geo::k_GeographicToGeocentric = 0.993277
static

Latitude geographic to geocentric conversion factor.

constexpr double glass3::util::Geo::k_KmToDegrees = 0.00899
static

Kilometers to Degrees conversion factor based on 6371 as the average radius.

constexpr double glass3::util::Geo::k_LongitudeWrap = 360.0
static

Longitude wrap factor.

constexpr double glass3::util::Geo::k_MaximumLatitude = 90.0
static

Maximum possible latitude value.

constexpr double glass3::util::Geo::k_MaximumLongitude = 180.0
static

Maximum possible longitude value.

constexpr double glass3::util::Geo::k_MinimumLatitude = -90.0
static

Minimum possible latitude value.

constexpr double glass3::util::Geo::k_MinimumLongitude = -180.0
static

Minimum possible longitude value.

double glass3::util::Geo::m_dCartesianX

the double value containing the Cartesian x coordinate.

double glass3::util::Geo::m_dCartesianY

the double value containing the Cartesian y coordinate.

double glass3::util::Geo::m_dCartesianZ

the double value containing the Cartesian z coordinate.

double glass3::util::Geo::m_dGeocentricLatitude

the double value containing the geocentric latitude in degrees.

double glass3::util::Geo::m_dGeocentricLongitude

the double value containing the geocentric longitude in degrees.

double glass3::util::Geo::m_dGeocentricRadius

the double value containing the geocentric radius in kilometers.

double glass3::util::Geo::m_dUnitVectorX

the double value containing the x unit vector used in delta calculations

double glass3::util::Geo::m_dUnitVectorY

the double value containing the y unit vector used in delta calculations

double glass3::util::Geo::m_dUnitVectorZ

the double value containing the z unit vector used in delta calculations


The documentation for this class was generated from the following files: