GeographicLib  1.21
Static Public Attributes | Friends
GeographicLib::NormalGravity Class Reference

The normal gravity of the earth. More...

#include <GeographicLib/NormalGravity.hpp>

List of all members.

Public Member Functions

Setting up the normal gravity
 NormalGravity (real a, real GM, real omega, real f, real J2)
 NormalGravity ()
Compute the gravity
Math::real SurfaceGravity (real lat) const throw ()
Math::real Gravity (real lat, real h, real &gammay, real &gammaz) const throw ()
Math::real U (real X, real Y, real Z, real &gammaX, real &gammaY, real &gammaZ) const throw ()
Math::real V0 (real X, real Y, real Z, real &GammaX, real &GammaY, real &GammaZ) const throw ()
Math::real Phi (real X, real Y, real &fX, real &fY) const throw ()
Inspector functions
bool Init () const throw ()
Math::real MajorRadius () const throw ()
Math::real MassConstant () const throw ()
Math::real DynamicalFormFactor (int n=2) const throw ()
Math::real AngularVelocity () const throw ()
Math::real Flattening () const throw ()
Math::real EquatorialGravity () const throw ()
Math::real PolarGravity () const throw ()
Math::real GravityFlattening () const throw ()
Math::real SurfacePotential () const throw ()
const GeocentricEarth () const throw ()

Static Public Attributes

static const NormalGravity WGS84
static const NormalGravity GRS80

Friends

class GravityModel

Detailed Description

The normal gravity of the earth.

"Normal" gravity refers to an idealization of the earth which is modeled as an rotating ellipsoid. The eccentricity of the ellipsoid, the rotation speed, and the distribution of mass within the ellipsoid are such that the surface of the ellipsoid is a surface of constant potential (gravitational plus centrifugal). The acceleration due to gravity is therefore perpendicular to the surface of the ellipsoid.

There is a closed solution to this problem which is implemented here. Series "approximations" are only used to evaluate certain combinations of elementary functions where use of the closed expression results in a loss of accuracy for small arguments due to cancellation of the two leading terms. However these series include sufficient terms to give full machine precision.

Definitions:

References:

Example of use:

// Example of using the GeographicLib::NormalGravity class
// $Id: 8d0337072d40334e8147a50b1e6035d75d38c53c $

#include <iostream>
#include <exception>
#include <GeographicLib/NormalGravity.hpp>
#include <GeographicLib/Constants.hpp>

using namespace std;
using namespace GeographicLib;

int main() {
  try {
    NormalGravity grav(Constants::WGS84_a(), Constants::WGS84_GM<double>(),
                       Constants::WGS84_omega<double>(),
                       Constants::WGS84_f(), 0);
    // Alternatively: const NormalGravity& grav = NormalGravity::WGS84;
    double lat = 27.99, h = 8820; // Mt Everest
    double gammay, gammaz;
    grav.Gravity(lat, h, gammay, gammaz);
    cout << gammay << " " << gammaz << "\n";
  }
  catch (const exception& e) {
    cerr << "Caught exception: " << e.what() << "\n";
    return 1;
  }
  return 0;
}

Constructor & Destructor Documentation

GeographicLib::NormalGravity::NormalGravity ( real  a,
real  GM,
real  omega,
real  f,
real  J2 
)

Constructor for the normal gravity.

Parameters:
[in]aequatorial radius (meters).
[in]GMmass constant of the ellipsoid (meters3/seconds2); this is the product of G the gravitational constant and M the mass of the earth (usually including the mass of the earth's atmosphere).
[in]omegathe angular velocity (rad s-1).
[in]fthe flattening of the ellipsoid.
[in]J2dynamical form factor.

Exactly one of f and J2 should be positive and this will be used to define the ellipsoid. The shape of the ellipsoid can be given in one of two ways:

  • geometrically, the ellipsoid is defined by the flattening f = (a - b) / a, where a and b are the equatorial radius and the polar semi-axis.
  • physically, the ellipsoid is defined by the dynamical form factor J2 = (C - A) / Ma2, where A and C are the equatorial and polar moments of inertia and M is the mass of the earth.

Definition at line 22 of file NormalGravity.cpp.

References GeographicLib::Math::isfinite().

GeographicLib::NormalGravity::NormalGravity ( ) [inline]

A default constructor for the normal gravity. This sets up an uninitialized object and is used by GravityModel which constructs this object before it has read in the parameters for the reference ellipsoid.

Definition at line 107 of file NormalGravity.hpp.


Member Function Documentation

Math::real GeographicLib::NormalGravity::SurfaceGravity ( real  lat) const throw ()

Evaluate the gravity on the surface of the ellipsoid.

Parameters:
[in]latthe geographic latitude (degrees).
Returns:
gamma the acceleration due to gravity, positive downwards (m s-2).

Due to the axial symmetry of the ellipsoid, the result is independent of the value of the longitude. This acceleration is perpendicular to the surface of the ellipsoid. It includes the effects of the earth's rotation.

Definition at line 155 of file NormalGravity.cpp.

References GeographicLib::Math::sq().

Referenced by GeographicLib::GravityModel::Circle().

Math::real GeographicLib::NormalGravity::Gravity ( real  lat,
real  h,
real &  gammay,
real &  gammaz 
) const throw ()

Evaluate the gravity at an arbitrary point above (or below) the ellipsoid.

Parameters:
[in]latthe geographic latitude (degrees).
[in]hthe height above the ellipsoid (meters).
[out]gammaythe northerly component of the acceleration (m s-2).
[out]gammazthe upward component of the acceleration (m s-2); this is usually negative.
Returns:
U the corresponding normal potential.

Due to the axial symmetry of the ellipsoid, the result is independent of the value of the longitude and the easterly component of the acceleration vanishes, gammax = 0. The function includes the effects of the earth's rotation. When h = 0, this function gives gammay = 0 and the returned value matches that of NormalGravity::SurfaceGravity.

Definition at line 226 of file NormalGravity.cpp.

Math::real GeographicLib::NormalGravity::U ( real  X,
real  Y,
real  Z,
real &  gammaX,
real &  gammaY,
real &  gammaZ 
) const throw ()

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

Parameters:
[in]Xgeocentric coordinate of point (meters).
[in]Ygeocentric coordinate of point (meters).
[in]Zgeocentric coordinate of point (meters).
[out]gammaXthe X component of the acceleration (m s-2).
[out]gammaYthe Y component of the acceleration (m s-2).
[out]gammaZthe Z component of the acceleration (m s-2).
Returns:
U = V0 + Phi the sum of the gravitational and centrifugal potentials (m2 s-2).

The acceleration given by gamma = grad U = grad V0 + grad Phi = Gamma + f.

Definition at line 216 of file NormalGravity.cpp.

Referenced by GeographicLib::GravityModel::Circle().

Math::real GeographicLib::NormalGravity::V0 ( real  X,
real  Y,
real  Z,
real &  GammaX,
real &  GammaY,
real &  GammaZ 
) const throw ()

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

Parameters:
[in]Xgeocentric coordinate of point (meters).
[in]Ygeocentric coordinate of point (meters).
[in]Zgeocentric coordinate of point (meters).
[out]GammaXthe X component of the acceleration due to gravity (m s-2).
[out]GammaYthe Y component of the acceleration due to gravity (m s-2).
[out]GammaZthe Z component of the acceleration due to gravity (m s-2).
Returns:
V0 the gravitational potential (m2 s-2).

This function excludes the centrifugal acceleration and is appropriate to use for space applications. In terrestrial applications, the function NormalGravity::U (which includes this effect) should usually be used.

Definition at line 163 of file NormalGravity.cpp.

References GeographicLib::Math::hypot(), and GeographicLib::Math::sq().

Math::real GeographicLib::NormalGravity::Phi ( real  X,
real  Y,
real &  fX,
real &  fY 
) const throw ()

Evaluate the centrifugal acceleration in geocentric coordinates.

Parameters:
[in]Xgeocentric coordinate of point (meters).
[in]Ygeocentric coordinate of point (meters).
[out]fXthe X component of the centrifugal acceleration (m s-2).
[out]fYthe Y component of the centrifugal acceleration (m s-2).
Returns:
Phi the centrifugal potential (m2 s-2).

Phi is independent of Z, thus fZ = 0. This function NormalGravity::U sums the results of NormalGravity::V0 and NormalGravity::Phi.

Definition at line 208 of file NormalGravity.cpp.

References GeographicLib::Math::sq().

Referenced by GeographicLib::GravityModel::Circle().

bool GeographicLib::NormalGravity::Init ( ) const throw () [inline]
Returns:
true if the object has been initialized.

Definition at line 219 of file NormalGravity.hpp.

Math::real GeographicLib::NormalGravity::MajorRadius ( ) const throw () [inline]
Returns:
a the equatorial radius of the ellipsoid (meters). This is the value used in the constructor.

Definition at line 225 of file NormalGravity.hpp.

Math::real GeographicLib::NormalGravity::MassConstant ( ) const throw () [inline]
Returns:
GM the mass constant of the ellipsoid (m3 s-2). This is the value used in the constructor.

Definition at line 233 of file NormalGravity.hpp.

Referenced by GeographicLib::GravityModel::GravityModel().

Math::real GeographicLib::NormalGravity::DynamicalFormFactor ( int  n = 2) const throw () [inline]
Returns:
Jn the dynamical form factors of the ellipsoid.

If n = 2 (the default), this is the value of J2 used in the constructor. Otherwise it is the zonal coefficient of the Legendre harmonic sum of the normal gravitational potential. Note that Jn = 0 if is odd. In most gravity applications, fully normalized Legendre functions are used and the corresponding coefficient is Cn0 = -Jn / sqrt(2 n + 1).

Definition at line 246 of file NormalGravity.hpp.

Math::real GeographicLib::NormalGravity::AngularVelocity ( ) const throw () [inline]
Returns:
omega the angular velocity of the ellipsoid (rad s-1). This is the value used in the constructor.

Definition at line 253 of file NormalGravity.hpp.

Math::real GeographicLib::NormalGravity::Flattening ( ) const throw () [inline]
Returns:
f the flattening of the ellipsoid (a - b)/a.

Definition at line 259 of file NormalGravity.hpp.

Math::real GeographicLib::NormalGravity::EquatorialGravity ( ) const throw () [inline]
Returns:
gammae the normal gravity at equator (m s-2).

Definition at line 266 of file NormalGravity.hpp.

Math::real GeographicLib::NormalGravity::PolarGravity ( ) const throw () [inline]
Returns:
gammap the normal gravity at poles (m s-2).

Definition at line 273 of file NormalGravity.hpp.

Math::real GeographicLib::NormalGravity::GravityFlattening ( ) const throw () [inline]
Returns:
f* the gravity flattening (gammap - gammae) / gammae.

Definition at line 281 of file NormalGravity.hpp.

Math::real GeographicLib::NormalGravity::SurfacePotential ( ) const throw () [inline]
Returns:
U0 the constant normal potential for the surface of the ellipsoid (m2 s-2).

Definition at line 288 of file NormalGravity.hpp.

const Geocentric& GeographicLib::NormalGravity::Earth ( ) const throw () [inline]
Returns:
the Geocentric object used by this instance.

Definition at line 294 of file NormalGravity.hpp.

Referenced by GeographicLib::GravityModel::Circle().


Friends And Related Function Documentation

friend class GravityModel [friend]

Definition at line 65 of file NormalGravity.hpp.


Member Data Documentation

A global instantiation of NormalGravity for the WGS84 ellipsoid.

Definition at line 300 of file NormalGravity.hpp.

A global instantiation of NormalGravity for the GRS80 ellipsoid.

Definition at line 305 of file NormalGravity.hpp.


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