Public Member Functions | Private Member Functions | Private Attributes | List of all members
NETGeographicLib::GravityCircle Class Reference

.NET wrapper for GeographicLib::GravityCircle. More...

#include <GravityCircle.h>

Public Member Functions

 GravityCircle (const GeographicLib::GravityCircle &gc)
 
 ~GravityCircle ()
 
Compute the gravitational field
double Gravity (double lon, [System::Runtime::InteropServices::Out] double% gx, [System::Runtime::InteropServices::Out] double% gy, [System::Runtime::InteropServices::Out] double% gz)
 
double Disturbance (double lon, [System::Runtime::InteropServices::Out] double% deltax, [System::Runtime::InteropServices::Out] double% deltay, [System::Runtime::InteropServices::Out] double% deltaz)
 
double GeoidHeight (double lon)
 
void SphericalAnomaly (double lon, [System::Runtime::InteropServices::Out] double% Dg01, [System::Runtime::InteropServices::Out] double% xi, [System::Runtime::InteropServices::Out] double% eta)
 
double W (double lon, [System::Runtime::InteropServices::Out] double% gX, [System::Runtime::InteropServices::Out] double% gY, [System::Runtime::InteropServices::Out] double% gZ)
 
double V (double lon, [System::Runtime::InteropServices::Out] double% GX, [System::Runtime::InteropServices::Out] double% GY, [System::Runtime::InteropServices::Out] double% GZ)
 
double T (double lon, [System::Runtime::InteropServices::Out] double% deltaX, [System::Runtime::InteropServices::Out] double% deltaY, [System::Runtime::InteropServices::Out] double% deltaZ)
 
double T (double lon)
 

Private Member Functions

 !GravityCircle (void)
 

Private Attributes

const GeographicLib::GravityCirclem_pGravityCircle
 

Inspector functions

property bool Init { bool get()
 
property double MajorRadius { double get()
 
property double Flattening { double get()
 
property double Latitude { double get()
 
property double Height { double get()
 
GravityModel::Mask Capabilities ()
 
bool Capabilities (GravityModel::Mask testcaps)
 

Detailed Description

.NET wrapper for GeographicLib::GravityCircle.

This class allows .NET applications to access GeographicLib::GravityCircle.

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.

C# Example:

using System;
namespace example_GravityCircle
{
class Program
{
static void Main(string[] args)
{
try {
GravityModel grav = new GravityModel("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, out gx, out gy, out gz);
Console.WriteLine(String.Format("{0} {1} {2} {3}", lon, gx, gy, gz));
}
}
{
// Fast method of evaluating the values at several points on a circle of
// latitude using GravityCircle.
GravityCircle circ = grav.Circle(lat, h, GravityModel.Mask.ALL);
for (int i = -5; i <= 5; ++i) {
double lon = lon0 + i * 0.2;
double gx, gy, gz;
circ.Gravity(lon, out gx, out gy, out gz);
Console.WriteLine(String.Format("{0} {1} {2} {3}", lon, gx, gy, gz));
}
}
}
catch (GeographicErr e) {
Console.WriteLine(String.Format("Caught exception: {0}", e.Message));
}
}
}
}

Managed C++ Example:

// 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;
}
}

Visual Basic Example:

Imports NETGeographicLib
Module example_GravityCircle
Sub Main()
Try
Dim grav As GravityModel = New GravityModel("egm96", "")
Dim lat As Double = 27.99, lon0 = 86.93, h = 8820 ' Mt Everest
' Slow method of evaluating the values at several points on a circle of
' latitude.
For i As Integer = -5 To 5
Dim lon As Double = lon0 + i * 0.2
Dim gx, gy, gz As Double
grav.Gravity(lat, lon, h, gx, gy, gz)
Console.WriteLine(String.Format("{0} {1} {2} {3}", lon, gx, gy, gz))
Next
' Fast method of evaluating the values at several points on a circle of
' latitude using GravityCircle.
Dim circ As GravityCircle = grav.Circle(lat, h, GravityModel.Mask.ALL)
For i As Integer = -5 To 5
Dim lon As Double = lon0 + i * 0.2
Dim gx, gy, gz As Double
circ.Gravity(lon, gx, gy, gz)
Console.WriteLine(String.Format("{0} {1} {2} {3}", lon, gx, gy, gz))
Next
Catch ex As GeographicErr
Console.WriteLine(String.Format("Caught exception: {0}", ex.Message))
End Try
End Sub
End Module

INTERFACE DIFFERENCES:
The following functions are implemented as properties: Init, MajorRadius, Flattening, Latitude, and Height.

The Capabilities functions accept and return the "capabilities mask" as a NETGeographicLib::GravityModel::Mask rather than an unsigned.

Definition at line 45 of file GravityCircle.h.

Constructor & Destructor Documentation

◆ !GravityCircle()

GravityCircle::!GravityCircle ( void  )
private

Definition at line 20 of file dotnet/NETGeographicLib/GravityCircle.cpp.

◆ GravityCircle()

GravityCircle::GravityCircle ( const GeographicLib::GravityCircle gc)

A constructor that is initialized from an unmanaged GeographicLib::GravityCircle. For internal use only. Developers should use GravityModel::Circle to create a GavityCircle object.

Definition at line 30 of file dotnet/NETGeographicLib/GravityCircle.cpp.

◆ ~GravityCircle()

NETGeographicLib::GravityCircle::~GravityCircle ( )
inline

The destructor calls the finalizer.

Definition at line 64 of file GravityCircle.h.

Member Function Documentation

◆ Capabilities() [1/2]

GravityModel::Mask GravityCircle::Capabilities ( )
Returns
caps the computational capabilities that this object was constructed with.

Definition at line 173 of file dotnet/NETGeographicLib/GravityCircle.cpp.

◆ Capabilities() [2/2]

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

Definition at line 177 of file dotnet/NETGeographicLib/GravityCircle.cpp.

◆ Disturbance()

double GravityCircle::Disturbance ( double  lon,
[System::Runtime::InteropServices::Out] double%  deltax,
[System::Runtime::InteropServices::Out] double%  deltay,
[System::Runtime::InteropServices::Out] double%  deltaz 
)

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.

Definition at line 57 of file dotnet/NETGeographicLib/GravityCircle.cpp.

◆ GeoidHeight()

double GravityCircle::GeoidHeight ( double  lon)

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 71 of file dotnet/NETGeographicLib/GravityCircle.cpp.

◆ Gravity()

double GravityCircle::Gravity ( double  lon,
[System::Runtime::InteropServices::Out] double%  gx,
[System::Runtime::InteropServices::Out] double%  gy,
[System::Runtime::InteropServices::Out] double%  gz 
)

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.

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

Definition at line 43 of file dotnet/NETGeographicLib/GravityCircle.cpp.

◆ SphericalAnomaly()

void GravityCircle::SphericalAnomaly ( double  lon,
[System::Runtime::InteropServices::Out] double%  Dg01,
[System::Runtime::InteropServices::Out] double%  xi,
[System::Runtime::InteropServices::Out] double%  eta 
)

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 77 of file dotnet/NETGeographicLib/GravityCircle.cpp.

◆ T() [1/2]

double GravityCircle::T ( double  lon)

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 132 of file dotnet/NETGeographicLib/GravityCircle.cpp.

◆ T() [2/2]

double GravityCircle::T ( double  lon,
[System::Runtime::InteropServices::Out] double%  deltaX,
[System::Runtime::InteropServices::Out] double%  deltaY,
[System::Runtime::InteropServices::Out] double%  deltaZ 
)

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 118 of file dotnet/NETGeographicLib/GravityCircle.cpp.

◆ V()

double GravityCircle::V ( double  lon,
[System::Runtime::InteropServices::Out] double%  GX,
[System::Runtime::InteropServices::Out] double%  GY,
[System::Runtime::InteropServices::Out] double%  GZ 
)

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 104 of file dotnet/NETGeographicLib/GravityCircle.cpp.

◆ W()

double GravityCircle::W ( double  lon,
[System::Runtime::InteropServices::Out] double%  gX,
[System::Runtime::InteropServices::Out] double%  gY,
[System::Runtime::InteropServices::Out] double%  gZ 
)

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 90 of file dotnet/NETGeographicLib/GravityCircle.cpp.

Member Data Documentation

◆ Flattening

property double NETGeographicLib::GravityCircle::Flattening { double get()
Returns
f the flattening of the ellipsoid. This is the value inherited from the GravityModel object used in the constructor. This property throws an exception if the GravityCircles has not been initialized.

Definition at line 230 of file GravityCircle.h.

◆ Height

property double NETGeographicLib::GravityCircle::Height { double get()
Returns
the height of the circle (meters). This property throws an exception if the GravityCircles has not been initialized.

Definition at line 244 of file GravityCircle.h.

◆ Init

property bool NETGeographicLib::GravityCircle::Init { bool get()
Returns
true if the object has been initialized.

Definition at line 213 of file GravityCircle.h.

◆ Latitude

property double NETGeographicLib::GravityCircle::Latitude { double get()
Returns
the latitude of the circle (degrees). This property throws an exception if the GravityCircles has not been initialized.

Definition at line 237 of file GravityCircle.h.

◆ m_pGravityCircle

const GeographicLib::GravityCircle* NETGeographicLib::GravityCircle::m_pGravityCircle
private

Definition at line 49 of file GravityCircle.h.

◆ MajorRadius

property double NETGeographicLib::GravityCircle::MajorRadius { double get()
Returns
a the equatorial radius of the ellipsoid (meters). This is the value inherited from the GravityModel object used in the constructor. This property throws an exception if the GravityCircles has not been initialized.

Definition at line 222 of file GravityCircle.h.


The documentation for this class was generated from the following files:
GeographicLib::GravityCircle
Gravity on a circle of latitude.
Definition: GravityCircle.hpp:41
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
h
const double h
Definition: testSimpleHelicopter.cpp:19
GravityModel.hpp
Header for GeographicLib::GravityModel class.
main
int main(int argc, char **argv)
Definition: cmake/example_cmake_find_gtsam/main.cpp:63
GravityCircle.hpp
Header for GeographicLib::GravityCircle class.
example::lon0
const double lon0
Definition: testGPSFactor.cpp:41
out
std::ofstream out("Result.txt")
GeographicLib::GravityCircle::Gravity
Math::real Gravity(real lon, real &gx, real &gy, real &gz) const
Definition: src/GravityCircle.cpp:19
std
Definition: BFloat16.h:88
args
Definition: pytypes.h:2210
lon
static const double lon
Definition: testGeographicLib.cpp:34
NETGeographicLib::GravityCircle::GravityCircle
GravityCircle(const GeographicLib::GravityCircle &gc)
Definition: dotnet/NETGeographicLib/GravityCircle.cpp:30
GeographicLib::GravityModel
Model of the earth's gravity field.
Definition: GravityModel.hpp:83
NETGeographicLib
Definition: Accumulator.h:13
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
lat
static const double lat
Definition: testGeographicLib.cpp:34


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:16:46