Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
GeographicLib::GravityCircle Class Reference

Gravity on a circle of latitude. More...

#include <GravityCircle.hpp>

Public Member Functions

 GravityCircle ()
 
Compute the gravitational field
Math::real Gravity (real lon, real &gx, real &gy, real &gz) const
 
Math::real Disturbance (real lon, real &deltax, real &deltay, real &deltaz) const
 
Math::real GeoidHeight (real lon) const
 
void SphericalAnomaly (real lon, real &Dg01, real &xi, real &eta) const
 
Math::real W (real lon, real &gX, real &gY, real &gZ) const
 
Math::real V (real lon, real &GX, real &GY, real &GZ) const
 
Math::real T (real lon, real &deltaX, real &deltaY, real &deltaZ) const
 
Math::real T (real lon) const
 
Inspector functions
bool Init () const
 
Math::real MajorRadius () const
 
Math::real Flattening () const
 
Math::real Latitude () const
 
Math::real Height () const
 
unsigned Capabilities () const
 
bool Capabilities (unsigned testcaps) const
 

Private Types

enum  mask {
  NONE = GravityModel::NONE, GRAVITY = GravityModel::GRAVITY, DISTURBANCE = GravityModel::DISTURBANCE, DISTURBING_POTENTIAL = GravityModel::DISTURBING_POTENTIAL,
  GEOID_HEIGHT = GravityModel::GEOID_HEIGHT, SPHERICAL_ANOMALY = GravityModel::SPHERICAL_ANOMALY, ALL = GravityModel::ALL
}
 
typedef Math::real real
 

Private Member Functions

 GravityCircle (mask caps, real a, real f, real lat, real h, real Z, real P, real cphi, real sphi, real amodel, real GMmodel, real dzonal0, real corrmult, real gamma0, real gamma, real frot, const CircularEngine &gravitational, const CircularEngine &disturbing, const CircularEngine &correction)
 
Math::real InternalT (real slam, real clam, real &deltaX, real &deltaY, real &deltaZ, bool gradp, bool correct) const
 
Math::real V (real slam, real clam, real &gX, real &gY, real &gZ) const
 
Math::real W (real slam, real clam, real &gX, real &gY, real &gZ) const
 

Private Attributes

real _a
 
real _amodel
 
unsigned _caps
 
CircularEngine _correction
 
real _corrmult
 
real _cphi
 
real _cpsi
 
CircularEngine _disturbing
 
real _dzonal0
 
real _f
 
real _frot
 
real _gamma
 
real _gamma0
 
real _GMmodel
 
CircularEngine _gravitational
 
real _h
 
real _invR
 
real _lat
 
real _Px
 
real _sphi
 
real _spsi
 
real _Z
 

Friends

class GravityModel
 

Detailed Description

Gravity on a circle of latitude.

Evaluate the earth's gravity field on a circle of constant height and latitude. This uses a CircularEngine to pre-evaluate the inner sum of the spherical harmonic sum, allowing the values of the field at several different longitudes to be evaluated rapidly.

Use GravityModel::Circle to create a GravityCircle object. (The constructor for this class is private.)

See gravityparallel for an example of using GravityCircle (together with OpenMP) to speed up the computation of geoid heights.

Example of use:

// Example of using the GeographicLib::GravityCircle class
#include <iostream>
#include <exception>
using namespace std;
using namespace GeographicLib;
int main() {
try {
GravityModel grav("egm96");
double lat = 27.99, lon0 = 86.93, h = 8820; // Mt Everest
{
// Slow method of evaluating the values at several points on a circle of
// latitude.
for (int i = -5; i <= 5; ++i) {
double lon = lon0 + i * 0.2;
double gx, gy, gz;
grav.Gravity(lat, lon, h, gx, gy, gz);
cout << lon << " " << gx << " " << gy << " " << gz << "\n";
}
}
{
// Fast method of evaluating the values at several points on a circle of
// latitude using GravityCircle.
GravityCircle circ = grav.Circle(lat, h);
for (int i = -5; i <= 5; ++i) {
double lon = lon0 + i * 0.2;
double gx, gy, gz;
circ.Gravity(lon, gx, gy, gz);
cout << lon << " " << gx << " " << gy << " " << gz << "\n";
}
}
}
catch (const exception& e) {
cerr << "Caught exception: " << e.what() << "\n";
return 1;
}
}

Gravity is a command-line utility providing access to the functionality of GravityModel and GravityCircle.

Definition at line 41 of file GravityCircle.hpp.

Member Typedef Documentation

◆ real

Definition at line 43 of file GravityCircle.hpp.

Member Enumeration Documentation

◆ mask

Enumerator
NONE 
GRAVITY 
DISTURBANCE 
DISTURBING_POTENTIAL 
GEOID_HEIGHT 
SPHERICAL_ANOMALY 
ALL 

Definition at line 44 of file GravityCircle.hpp.

Constructor & Destructor Documentation

◆ GravityCircle() [1/2]

GeographicLib::GravityCircle::GravityCircle ( mask  caps,
real  a,
real  f,
real  lat,
real  h,
real  Z,
real  P,
real  cphi,
real  sphi,
real  amodel,
real  GMmodel,
real  dzonal0,
real  corrmult,
real  gamma0,
real  gamma,
real  frot,
const CircularEngine gravitational,
const CircularEngine disturbing,
const CircularEngine correction 
)
inlineprivate

Definition at line 60 of file GravityCircle.hpp.

◆ GravityCircle() [2/2]

GeographicLib::GravityCircle::GravityCircle ( )
inline

A default constructor for the normal gravity. This sets up an uninitialized object which can be later replaced by the GravityModel::Circle.

Definition at line 105 of file GravityCircle.hpp.

Member Function Documentation

◆ Capabilities() [1/2]

unsigned GeographicLib::GravityCircle::Capabilities ( ) const
inline
Returns
caps the computational capabilities that this object was constructed with.

Definition at line 289 of file GravityCircle.hpp.

◆ Capabilities() [2/2]

bool GeographicLib::GravityCircle::Capabilities ( unsigned  testcaps) const
inline
Parameters
[in]testcapsa set of bitor'ed GravityModel::mask values.
Returns
true if the GravityCircle object has all these capabilities.

Definition at line 295 of file GravityCircle.hpp.

◆ Disturbance()

Math::real GeographicLib::GravityCircle::Disturbance ( real  lon,
real deltax,
real deltay,
real deltaz 
) const

Evaluate the gravity disturbance vector.

Parameters
[in]lonthe geographic longitude (degrees).
[out]deltaxthe easterly component of the disturbance vector (m s−2).
[out]deltaythe northerly component of the disturbance vector (m s−2).
[out]deltazthe upward component of the disturbance vector (m s−2).
Returns
T the corresponding disturbing potential (m2 s−2).

Definition at line 29 of file src/GravityCircle.cpp.

◆ Flattening()

Math::real GeographicLib::GravityCircle::Flattening ( ) const
inline
Returns
f the flattening of the ellipsoid. This is the value inherited from the GravityModel object used in the constructor.

Definition at line 270 of file GravityCircle.hpp.

◆ GeoidHeight()

Math::real GeographicLib::GravityCircle::GeoidHeight ( real  lon) const

Evaluate the geoid height.

Parameters
[in]lonthe geographic longitude (degrees).
Returns
N the height of the geoid above the reference ellipsoid (meters).

Some approximations are made in computing the geoid height so that the results of the NGA codes are reproduced accurately. Details are given in gravitygeoid.

Definition at line 39 of file src/GravityCircle.cpp.

◆ Gravity()

Math::real GeographicLib::GravityCircle::Gravity ( real  lon,
real gx,
real gy,
real gz 
) const

Evaluate the gravity.

Parameters
[in]lonthe geographic longitude (degrees).
[out]gxthe easterly component of the acceleration (m s−2).
[out]gythe northerly component of the acceleration (m s−2).
[out]gzthe upward component of the acceleration (m s−2); this is usually negative.
Returns
W the sum of the gravitational and centrifugal potentials (m2 s−2).

The function includes the effects of the earth's rotation.

Definition at line 19 of file src/GravityCircle.cpp.

◆ Height()

Math::real GeographicLib::GravityCircle::Height ( ) const
inline
Returns
the height of the circle (meters).

Definition at line 282 of file GravityCircle.hpp.

◆ Init()

bool GeographicLib::GravityCircle::Init ( ) const
inline
Returns
true if the object has been initialized.

Definition at line 256 of file GravityCircle.hpp.

◆ InternalT()

Math::real GeographicLib::GravityCircle::InternalT ( real  slam,
real  clam,
real deltaX,
real deltaY,
real deltaZ,
bool  gradp,
bool  correct 
) const
private

Definition at line 94 of file src/GravityCircle.cpp.

◆ Latitude()

Math::real GeographicLib::GravityCircle::Latitude ( ) const
inline
Returns
the latitude of the circle (degrees).

Definition at line 276 of file GravityCircle.hpp.

◆ MajorRadius()

Math::real GeographicLib::GravityCircle::MajorRadius ( ) const
inline
Returns
a the equatorial radius of the ellipsoid (meters). This is the value inherited from the GravityModel object used in the constructor.

Definition at line 263 of file GravityCircle.hpp.

◆ SphericalAnomaly()

void GeographicLib::GravityCircle::SphericalAnomaly ( real  lon,
real Dg01,
real xi,
real eta 
) const

Evaluate the components of the gravity anomaly vector using the spherical approximation.

Parameters
[in]lonthe geographic longitude (degrees).
[out]Dg01the gravity anomaly (m s−2).
[out]xithe northerly component of the deflection of the vertical (degrees).
[out]etathe easterly component of the deflection of the vertical (degrees).

The spherical approximation (see Heiskanen and Moritz, Sec 2-14) is used so that the results of the NGA codes are reproduced accurately. approximations used here. Details are given in gravitygeoid.

Definition at line 49 of file src/GravityCircle.cpp.

◆ T() [1/2]

Math::real GeographicLib::GravityCircle::T ( real  lon,
real deltaX,
real deltaY,
real deltaZ 
) const
inline

Evaluate the components of the gravity disturbance in geocentric coordinates.

Parameters
[in]lonthe geographic longitude (degrees).
[out]deltaXthe X component of the gravity disturbance (m s−2).
[out]deltaYthe Y component of the gravity disturbance (m s−2).
[out]deltaZthe Z component of the gravity disturbance (m s−2).
Returns
T = W - U the disturbing potential (also called the anomalous potential) (m2 s−2).

Definition at line 228 of file GravityCircle.hpp.

◆ T() [2/2]

Math::real GeographicLib::GravityCircle::T ( real  lon) const
inline

Evaluate disturbing potential in geocentric coordinates.

Parameters
[in]lonthe geographic longitude (degrees).
Returns
T = W - U the disturbing potential (also called the anomalous potential) (m2 s−2).

Definition at line 242 of file GravityCircle.hpp.

◆ V() [1/2]

Math::real GeographicLib::GravityCircle::V ( real  slam,
real  clam,
real gX,
real gY,
real gZ 
) const
private

Definition at line 78 of file src/GravityCircle.cpp.

◆ V() [2/2]

Math::real GeographicLib::GravityCircle::V ( real  lon,
real GX,
real GY,
real GZ 
) const
inline

Evaluate the components of the acceleration due to gravity in geocentric coordinates.

Parameters
[in]lonthe geographic longitude (degrees).
[out]GXthe X component of the acceleration (m s−2).
[out]GYthe Y component of the acceleration (m s−2).
[out]GZthe Z component of the acceleration (m s−2).
Returns
V = W - Φ the gravitational potential (m2 s−2).

Definition at line 208 of file GravityCircle.hpp.

◆ W() [1/2]

Math::real GeographicLib::GravityCircle::W ( real  slam,
real  clam,
real gX,
real gY,
real gZ 
) const
private

Definition at line 70 of file src/GravityCircle.cpp.

◆ W() [2/2]

Math::real GeographicLib::GravityCircle::W ( real  lon,
real gX,
real gY,
real gZ 
) const
inline

Evaluate the components of the acceleration due to gravity and the centrifugal acceleration in geocentric coordinates.

Parameters
[in]lonthe geographic longitude (degrees).
[out]gXthe X component of the acceleration (m s−2).
[out]gYthe Y component of the acceleration (m s−2).
[out]gZthe Z component of the acceleration (m s−2).
Returns
W = V + Φ the sum of the gravitational and centrifugal potentials (m2 s−2).

Definition at line 188 of file GravityCircle.hpp.

Friends And Related Function Documentation

◆ GravityModel

friend class GravityModel
friend

Definition at line 91 of file GravityCircle.hpp.

Member Data Documentation

◆ _a

real GeographicLib::GravityCircle::_a
private

Definition at line 55 of file GravityCircle.hpp.

◆ _amodel

real GeographicLib::GravityCircle::_amodel
private

Definition at line 55 of file GravityCircle.hpp.

◆ _caps

unsigned GeographicLib::GravityCircle::_caps
private

Definition at line 54 of file GravityCircle.hpp.

◆ _correction

CircularEngine GeographicLib::GravityCircle::_correction
private

Definition at line 58 of file GravityCircle.hpp.

◆ _corrmult

real GeographicLib::GravityCircle::_corrmult
private

Definition at line 55 of file GravityCircle.hpp.

◆ _cphi

real GeographicLib::GravityCircle::_cphi
private

Definition at line 55 of file GravityCircle.hpp.

◆ _cpsi

real GeographicLib::GravityCircle::_cpsi
private

Definition at line 55 of file GravityCircle.hpp.

◆ _disturbing

CircularEngine GeographicLib::GravityCircle::_disturbing
private

Definition at line 58 of file GravityCircle.hpp.

◆ _dzonal0

real GeographicLib::GravityCircle::_dzonal0
private

Definition at line 55 of file GravityCircle.hpp.

◆ _f

real GeographicLib::GravityCircle::_f
private

Definition at line 55 of file GravityCircle.hpp.

◆ _frot

real GeographicLib::GravityCircle::_frot
private

Definition at line 55 of file GravityCircle.hpp.

◆ _gamma

real GeographicLib::GravityCircle::_gamma
private

Definition at line 55 of file GravityCircle.hpp.

◆ _gamma0

real GeographicLib::GravityCircle::_gamma0
private

Definition at line 55 of file GravityCircle.hpp.

◆ _GMmodel

real GeographicLib::GravityCircle::_GMmodel
private

Definition at line 55 of file GravityCircle.hpp.

◆ _gravitational

CircularEngine GeographicLib::GravityCircle::_gravitational
private

Definition at line 58 of file GravityCircle.hpp.

◆ _h

real GeographicLib::GravityCircle::_h
private

Definition at line 55 of file GravityCircle.hpp.

◆ _invR

real GeographicLib::GravityCircle::_invR
private

Definition at line 55 of file GravityCircle.hpp.

◆ _lat

real GeographicLib::GravityCircle::_lat
private

Definition at line 55 of file GravityCircle.hpp.

◆ _Px

real GeographicLib::GravityCircle::_Px
private

Definition at line 55 of file GravityCircle.hpp.

◆ _sphi

real GeographicLib::GravityCircle::_sphi
private

Definition at line 55 of file GravityCircle.hpp.

◆ _spsi

real GeographicLib::GravityCircle::_spsi
private

Definition at line 55 of file GravityCircle.hpp.

◆ _Z

real GeographicLib::GravityCircle::_Z
private

Definition at line 55 of file GravityCircle.hpp.


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


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:46:12