GeographicLib
1.21
|
The normal gravity of the earth. More...
#include <GeographicLib/NormalGravity.hpp>
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 Geocentric & | Earth () const throw () |
Static Public Attributes | |
static const NormalGravity | WGS84 |
static const NormalGravity | GRS80 |
Friends | |
class | GravityModel |
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; }
GeographicLib::NormalGravity::NormalGravity | ( | real | a, |
real | GM, | ||
real | omega, | ||
real | f, | ||
real | J2 | ||
) |
Constructor for the normal gravity.
[in] | a | equatorial radius (meters). |
[in] | GM | mass 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] | omega | the angular velocity (rad s-1). |
[in] | f | the flattening of the ellipsoid. |
[in] | J2 | dynamical 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:
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.
Math::real GeographicLib::NormalGravity::SurfaceGravity | ( | real | lat | ) | const throw () |
Evaluate the gravity on the surface of the ellipsoid.
[in] | lat | the geographic latitude (degrees). |
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.
[in] | lat | the geographic latitude (degrees). |
[in] | h | the height above the ellipsoid (meters). |
[out] | gammay | the northerly component of the acceleration (m s-2). |
[out] | gammaz | the upward component of the acceleration (m s-2); this is usually negative. |
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.
[in] | X | geocentric coordinate of point (meters). |
[in] | Y | geocentric coordinate of point (meters). |
[in] | Z | geocentric coordinate of point (meters). |
[out] | gammaX | the X component of the acceleration (m s-2). |
[out] | gammaY | the Y component of the acceleration (m s-2). |
[out] | gammaZ | the Z component of the acceleration (m 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.
[in] | X | geocentric coordinate of point (meters). |
[in] | Y | geocentric coordinate of point (meters). |
[in] | Z | geocentric coordinate of point (meters). |
[out] | GammaX | the X component of the acceleration due to gravity (m s-2). |
[out] | GammaY | the Y component of the acceleration due to gravity (m s-2). |
[out] | GammaZ | the Z component of the acceleration due to gravity (m 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.
[in] | X | geocentric coordinate of point (meters). |
[in] | Y | geocentric coordinate of point (meters). |
[out] | fX | the X component of the centrifugal acceleration (m s-2). |
[out] | fY | the Y component of the centrifugal acceleration (m 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] |
Definition at line 219 of file NormalGravity.hpp.
Math::real GeographicLib::NormalGravity::MajorRadius | ( | ) | const throw () [inline] |
Definition at line 225 of file NormalGravity.hpp.
Math::real GeographicLib::NormalGravity::MassConstant | ( | ) | const throw () [inline] |
Definition at line 233 of file NormalGravity.hpp.
Referenced by GeographicLib::GravityModel::GravityModel().
Math::real GeographicLib::NormalGravity::DynamicalFormFactor | ( | int | n = 2 | ) | const throw () [inline] |
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] |
Definition at line 253 of file NormalGravity.hpp.
Math::real GeographicLib::NormalGravity::Flattening | ( | ) | const throw () [inline] |
Definition at line 259 of file NormalGravity.hpp.
Math::real GeographicLib::NormalGravity::EquatorialGravity | ( | ) | const throw () [inline] |
Definition at line 266 of file NormalGravity.hpp.
Math::real GeographicLib::NormalGravity::PolarGravity | ( | ) | const throw () [inline] |
Definition at line 273 of file NormalGravity.hpp.
Math::real GeographicLib::NormalGravity::GravityFlattening | ( | ) | const throw () [inline] |
Definition at line 281 of file NormalGravity.hpp.
Math::real GeographicLib::NormalGravity::SurfacePotential | ( | ) | const throw () [inline] |
Definition at line 288 of file NormalGravity.hpp.
const Geocentric& GeographicLib::NormalGravity::Earth | ( | ) | const throw () [inline] |
Definition at line 294 of file NormalGravity.hpp.
Referenced by GeographicLib::GravityModel::Circle().
friend class GravityModel [friend] |
Definition at line 65 of file NormalGravity.hpp.
const NormalGravity GeographicLib::NormalGravity::WGS84 [static] |
A global instantiation of NormalGravity for the WGS84 ellipsoid.
Definition at line 300 of file NormalGravity.hpp.
const NormalGravity GeographicLib::NormalGravity::GRS80 [static] |
A global instantiation of NormalGravity for the GRS80 ellipsoid.
Definition at line 305 of file NormalGravity.hpp.