.NET wrapper for GeographicLib::NormalGravity. More...
#include <NormalGravity.h>
Public Types | |
enum | StandardModels { StandardModels::WGS84, StandardModels::GRS80 } |
The enumerated standard gravity models. More... | |
Public Member Functions | |
~NormalGravity () | |
Setting up the normal gravity | |
NormalGravity (double a, double GM, double omega, double f_J2, bool geometricp) | |
NormalGravity (StandardModels model) | |
NormalGravity (const GeographicLib::NormalGravity &g) | |
Compute the gravity | |
double | SurfaceGravity (double lat) |
double | Gravity (double lat, double h, [System::Runtime::InteropServices::Out] double% gammay, [System::Runtime::InteropServices::Out] double% gammaz) |
double | U (double X, double Y, double Z, [System::Runtime::InteropServices::Out] double% gammaX, [System::Runtime::InteropServices::Out] double% gammaY, [System::Runtime::InteropServices::Out] double% gammaZ) |
double | V0 (double X, double Y, double Z, [System::Runtime::InteropServices::Out] double% GammaX, [System::Runtime::InteropServices::Out] double% GammaY, [System::Runtime::InteropServices::Out] double% GammaZ) |
double | Phi (double X, double Y, [System::Runtime::InteropServices::Out] double% fX, [System::Runtime::InteropServices::Out] double% fY) |
Static Public Member Functions | |
static double | FlatteningToJ2 (double a, double GM, double omega, double f) |
static NormalGravity | GRS80 () |
static double | J2ToFlattening (double a, double GM, double omega, double J2) |
static NormalGravity | WGS84 () |
Private Member Functions | |
!NormalGravity (void) | |
Private Attributes | |
const GeographicLib::NormalGravity * | m_pNormalGravity |
Inspector functions | |
property double | MajorRadius { double get() |
property double | MassConstant { double get() |
property double | AngularVelocity { double get() |
property double | Flattening { double get() |
property double | EquatorialGravity { double get() |
property double | PolarGravity { double get() |
property double | GravityFlattening { double get() |
property double | SurfacePotential { double get() |
double | DynamicalFormFactor (int n) |
Geocentric | Earth () |
.NET wrapper for GeographicLib::NormalGravity.
This class allows .NET applications to access GeographicLib::NormalGravity.
"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:
C# Example:
Managed C++ Example:
Visual Basic Example:
INTERFACE DIFFERENCES:
A constructor has been provided for creating standard WGS84 and GRS80 gravity models.
The following functions are implemented as properties: MajorRadius, MassConstant, AngularVelocity, Flattening, EquatorialGravity, PolarGravity, GravityFlattening, SurfacePotential.
Definition at line 71 of file NormalGravity.h.
|
strong |
The enumerated standard gravity models.
Enumerator | |
---|---|
WGS84 | WGS84 gravity model. |
GRS80 | GRS80 gravity model. |
Definition at line 81 of file NormalGravity.h.
|
private |
Definition at line 22 of file dotnet/NETGeographicLib/NormalGravity.cpp.
NormalGravity::NormalGravity | ( | double | a, |
double | GM, | ||
double | omega, | ||
double | f_J2, | ||
bool | geometricp | ||
) |
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_J2 | either the flattening of the ellipsoid f or the the dynamical form factor J2. |
[out] | geometricp | if true, then f_J2 denotes the flattening, else it denotes the dynamical form factor J2. |
if | a is not positive or if the other parameters do not obey the restrictions given below. |
The shape of the ellipsoid can be given in one of two ways:
Definition at line 32 of file dotnet/NETGeographicLib/NormalGravity.cpp.
NormalGravity::NormalGravity | ( | StandardModels | model | ) |
A constructor for creating standard gravity models..
[in] | model | Specifies the desired model. |
Definition at line 49 of file dotnet/NETGeographicLib/NormalGravity.cpp.
NormalGravity::NormalGravity | ( | const GeographicLib::NormalGravity & | g | ) |
A constructor that accepts a GeographicLib::NormalGravity. For internal use only.
g | An existing GeographicLib::NormalGravity. |
Definition at line 64 of file dotnet/NETGeographicLib/NormalGravity.cpp.
|
inline |
The destructor calls the finalizer.
Definition at line 140 of file NormalGravity.h.
double NormalGravity::DynamicalFormFactor | ( | int | n | ) |
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 n 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 149 of file dotnet/NETGeographicLib/NormalGravity.cpp.
Geocentric NormalGravity::Earth | ( | ) |
Definition at line 135 of file dotnet/NETGeographicLib/NormalGravity.cpp.
|
static |
Compute the dynamical form factor from the flattening.
[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. |
Definition at line 196 of file dotnet/NETGeographicLib/NormalGravity.cpp.
double NormalGravity::Gravity | ( | double | lat, |
double | h, | ||
[System::Runtime::InteropServices::Out] double% | gammay, | ||
[System::Runtime::InteropServices::Out] double% | gammaz | ||
) |
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 83 of file dotnet/NETGeographicLib/NormalGravity.cpp.
|
static |
A global instantiation of NormalGravity for the GRS80 ellipsoid.
Definition at line 183 of file dotnet/NETGeographicLib/NormalGravity.cpp.
|
static |
Compute the flattening from the dynamical form factor.
[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] | J2 | the dynamical form factor. |
Definition at line 189 of file dotnet/NETGeographicLib/NormalGravity.cpp.
double NormalGravity::Phi | ( | double | X, |
double | Y, | ||
[System::Runtime::InteropServices::Out] double% | fX, | ||
[System::Runtime::InteropServices::Out] double% | fY | ||
) |
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). |
Φ is independent of Z, thus fZ = 0. This function NormalGravity::U sums the results of NormalGravity::V0 and NormalGravity::Phi.
Definition at line 123 of file dotnet/NETGeographicLib/NormalGravity.cpp.
double NormalGravity::SurfaceGravity | ( | double | lat | ) |
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 77 of file dotnet/NETGeographicLib/NormalGravity.cpp.
double NormalGravity::U | ( | double | X, |
double | Y, | ||
double | Z, | ||
[System::Runtime::InteropServices::Out] double% | gammaX, | ||
[System::Runtime::InteropServices::Out] double% | gammaY, | ||
[System::Runtime::InteropServices::Out] double% | gammaZ | ||
) |
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 γ = ∇U = ∇V0 + ∇Φ = Γ + f.
Definition at line 95 of file dotnet/NETGeographicLib/NormalGravity.cpp.
double NormalGravity::V0 | ( | double | X, |
double | Y, | ||
double | Z, | ||
[System::Runtime::InteropServices::Out] double% | GammaX, | ||
[System::Runtime::InteropServices::Out] double% | GammaY, | ||
[System::Runtime::InteropServices::Out] double% | GammaZ | ||
) |
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 109 of file dotnet/NETGeographicLib/NormalGravity.cpp.
|
static |
A global instantiation of NormalGravity for the WGS84 ellipsoid.
Definition at line 177 of file dotnet/NETGeographicLib/NormalGravity.cpp.
property double NETGeographicLib::NormalGravity::AngularVelocity { double get() |
Definition at line 287 of file NormalGravity.h.
property double NETGeographicLib::NormalGravity::EquatorialGravity { double get() |
Definition at line 299 of file NormalGravity.h.
property double NETGeographicLib::NormalGravity::Flattening { double get() |
Definition at line 293 of file NormalGravity.h.
property double NETGeographicLib::NormalGravity::GravityFlattening { double get() |
Definition at line 311 of file NormalGravity.h.
|
private |
Definition at line 75 of file NormalGravity.h.
property double NETGeographicLib::NormalGravity::MajorRadius { double get() |
Definition at line 261 of file NormalGravity.h.
property double NETGeographicLib::NormalGravity::MassConstant { double get() |
Definition at line 268 of file NormalGravity.h.
property double NETGeographicLib::NormalGravity::PolarGravity { double get() |
Definition at line 305 of file NormalGravity.h.
property double NETGeographicLib::NormalGravity::SurfacePotential { double get() |
Definition at line 317 of file NormalGravity.h.