dotnet/NETGeographicLib/GravityCircle.cpp
Go to the documentation of this file.
1 
11 #include "stdafx.h"
13 #include "GravityModel.h"
14 #include "GravityCircle.h"
15 #include "NETGeographicLib.h"
16 
17 using namespace NETGeographicLib;
18 
19 //*****************************************************************************
21 {
22  if ( m_pGravityCircle != NULL )
23  {
24  delete m_pGravityCircle;
25  m_pGravityCircle = NULL;
26  }
27 }
28 
29 //*****************************************************************************
31 {
32  try
33  {
35  }
36  catch ( std::bad_alloc )
37  {
38  throw gcnew GeographicErr( "Failed to allocate memory for a GeographicLib::GravityCircle" );
39  }
40 }
41 
42 //*****************************************************************************
44  [System::Runtime::InteropServices::Out] double% gx,
45  [System::Runtime::InteropServices::Out] double% gy,
46  [System::Runtime::InteropServices::Out] double% gz)
47 {
48  double lgx, lgy, lgz;
49  double out = m_pGravityCircle->Gravity( lon, lgx, lgy, lgz );
50  gx = lgx;
51  gy = lgy;
52  gz = lgz;
53  return out;
54 }
55 
56 //*****************************************************************************
58  [System::Runtime::InteropServices::Out] double% deltax,
59  [System::Runtime::InteropServices::Out] double% deltay,
60  [System::Runtime::InteropServices::Out] double% deltaz)
61 {
62  double ldeltax, ldeltay, ldeltaz;
63  double out = m_pGravityCircle->Disturbance( lon, ldeltax, ldeltay, ldeltaz );
64  deltax = ldeltax;
65  deltay = ldeltay;
66  deltaz = ldeltaz;
67  return out;
68 }
69 
70 //*****************************************************************************
72 {
73  return m_pGravityCircle->GeoidHeight( lon );
74 }
75 
76 //*****************************************************************************
78  [System::Runtime::InteropServices::Out] double% Dg01,
79  [System::Runtime::InteropServices::Out] double% xi,
80  [System::Runtime::InteropServices::Out] double% eta)
81 {
82  double lDg01, lxi, leta;
83  m_pGravityCircle->SphericalAnomaly( lon, lDg01, lxi, leta );
84  Dg01 = lDg01;
85  xi = lxi;
86  eta = leta;
87 }
88 
89 //*****************************************************************************
90 double GravityCircle::W(double lon,
91  [System::Runtime::InteropServices::Out] double% gX,
92  [System::Runtime::InteropServices::Out] double% gY,
93  [System::Runtime::InteropServices::Out] double% gZ)
94 {
95  double lgx, lgy, lgz;
96  double out = m_pGravityCircle->W( lon, lgx, lgy, lgz );
97  gX = lgx;
98  gY = lgy;
99  gZ = lgz;
100  return out;
101 }
102 
103 //*****************************************************************************
104 double GravityCircle::V(double lon,
105  [System::Runtime::InteropServices::Out] double% GX,
106  [System::Runtime::InteropServices::Out] double% GY,
107  [System::Runtime::InteropServices::Out] double% GZ)
108 {
109  double lgx, lgy, lgz;
110  double out = m_pGravityCircle->V( lon, lgx, lgy, lgz );
111  GX = lgx;
112  GY = lgy;
113  GZ = lgz;
114  return out;
115 }
116 
117 //*****************************************************************************
118 double GravityCircle::T(double lon,
119  [System::Runtime::InteropServices::Out] double% deltaX,
120  [System::Runtime::InteropServices::Out] double% deltaY,
121  [System::Runtime::InteropServices::Out] double% deltaZ)
122 {
123  double lgx, lgy, lgz;
124  double out = m_pGravityCircle->T( lon, lgx, lgy, lgz );
125  deltaX = lgx;
126  deltaY = lgy;
127  deltaZ = lgz;
128  return out;
129 }
130 
131 //*****************************************************************************
132 double GravityCircle::T(double lon)
133 {
134  return m_pGravityCircle->T( lon );
135 }
136 
137 //*****************************************************************************
139 {
140  if ( m_pGravityCircle->Init() )
141  return m_pGravityCircle->MajorRadius();
142  throw gcnew GeographicErr("GravityCircle::MajorRadius failed because the GravityCircle is not initialized.");
143 }
144 
145 //*****************************************************************************
147 {
148  if ( m_pGravityCircle->Init() )
149  return m_pGravityCircle->Flattening();
150  throw gcnew GeographicErr("GravityCircle::Flattening failed because the GravityCircle is not initialized.");
151 }
152 
153 //*****************************************************************************
155 {
156  if ( m_pGravityCircle->Init() )
157  return m_pGravityCircle->Latitude();
158  throw gcnew GeographicErr("GravityCircle::Latitude failed because the GravityCircle is not initialized.");
159 }
160 
161 //*****************************************************************************
163 {
164  if ( m_pGravityCircle->Init() )
165  return m_pGravityCircle->Height();
166  throw gcnew GeographicErr("GravityCircle::Height failed because the GravityCircle is not initialized.");
167 }
168 
169 //*****************************************************************************
170 bool GravityCircle::Init::get() { return m_pGravityCircle->Init(); }
171 
172 //*****************************************************************************
174 { return static_cast<GravityModel::Mask>(m_pGravityCircle->Capabilities()); }
175 
176 //*****************************************************************************
178 { return m_pGravityCircle->Capabilities( (unsigned int)testcaps ); }
Math::real V(real slam, real clam, real &gX, real &gY, real &gZ) const
Header for NETGeographicLib::NETGeographicLib objects.
.NET wrapper for GeographicLib::GravityCircle.
Definition: GravityCircle.h:45
Exception class for NETGeographicLib.
std::ofstream out("Result.txt")
Math::real W(real slam, real clam, real &gX, real &gY, real &gZ) const
Math::real Flattening() const
double T(double lon, [System::Runtime::InteropServices::Out] double% deltaX, [System::Runtime::InteropServices::Out] double% deltaY, [System::Runtime::InteropServices::Out] double% deltaZ)
Header for NETGeographicLib::GravityModel class.
GravityCircle(const GeographicLib::GravityCircle &gc)
Header for NETGeographicLib::GravityCircle class.
Math::real T(real lon, real &deltaX, real &deltaY, real &deltaZ) const
Math::real MajorRadius() const
Math::real Gravity(real lon, real &gx, real &gy, real &gz) const
Math::real Disturbance(real lon, real &deltax, real &deltay, real &deltaz) const
#define NULL
Definition: ccolamd.c:609
void SphericalAnomaly(real lon, real &Dg01, real &xi, real &eta) const
Vector xi
Definition: testPose2.cpp:148
double Disturbance(double lon, [System::Runtime::InteropServices::Out] double% deltax, [System::Runtime::InteropServices::Out] double% deltay, [System::Runtime::InteropServices::Out] double% deltaz)
void SphericalAnomaly(double lon, [System::Runtime::InteropServices::Out] double% Dg01, [System::Runtime::InteropServices::Out] double% xi, [System::Runtime::InteropServices::Out] double% eta)
static const double lon
double Gravity(double lon, [System::Runtime::InteropServices::Out] double% gx, [System::Runtime::InteropServices::Out] double% gy, [System::Runtime::InteropServices::Out] double% gz)
double W(double lon, [System::Runtime::InteropServices::Out] double% gX, [System::Runtime::InteropServices::Out] double% gY, [System::Runtime::InteropServices::Out] double% gZ)
Container::iterator get(Container &c, Position position)
Header for GeographicLib::GravityCircle class.
const GeographicLib::GravityCircle * m_pGravityCircle
Definition: GravityCircle.h:49
Math::real GeoidHeight(real lon) const
Gravity on a circle of latitude.
double V(double lon, [System::Runtime::InteropServices::Out] double% GX, [System::Runtime::InteropServices::Out] double% GY, [System::Runtime::InteropServices::Out] double% GZ)


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:19