dotnet/NETGeographicLib/TransverseMercatorExact.cpp
Go to the documentation of this file.
1 
11 #include "stdafx.h"
14 #include "NETGeographicLib.h"
15 
16 using namespace NETGeographicLib;
17 
18 const char BADALLOC[] = "Unable to allocate memory for a GeographicLib::TransverseMercatorExact";
19 
20 //*****************************************************************************
22 {
23  if ( m_pTransverseMercatorExact != NULL )
24  {
25  delete m_pTransverseMercatorExact;
26  m_pTransverseMercatorExact = NULL;
27  }
28 }
29 
30 //*****************************************************************************
32  bool extendp)
33 {
34  try
35  {
37  a, f, k0, extendp );
38  }
39  catch (std::bad_alloc)
40  {
41  throw gcnew GeographicErr( BADALLOC );
42  }
43  catch ( std::exception err )
44  {
45  throw gcnew GeographicErr( err.what() );
46  }
47 }
48 
49 //*****************************************************************************
51 {
52  try
53  {
57  }
58  catch (std::bad_alloc)
59  {
60  throw gcnew GeographicErr( BADALLOC );
61  }
62 }
63 
64 //*****************************************************************************
65 void TransverseMercatorExact::Forward(double lon0, double lat, double lon,
66  [System::Runtime::InteropServices::Out] double% x,
67  [System::Runtime::InteropServices::Out] double% y,
68  [System::Runtime::InteropServices::Out] double% gamma,
69  [System::Runtime::InteropServices::Out] double% k)
70 {
71  double lx, ly, lgamma, lk;
73  lgamma, lk );
74  x = lx;
75  y = ly;
76  gamma = lgamma;
77  k = lk;
78 }
79 
80 //*****************************************************************************
81 void TransverseMercatorExact::Reverse(double lon0, double x, double y,
82  [System::Runtime::InteropServices::Out] double% lat,
83  [System::Runtime::InteropServices::Out] double% lon,
84  [System::Runtime::InteropServices::Out] double% gamma,
85  [System::Runtime::InteropServices::Out] double% k)
86 {
87  double llat, llon, lgamma, lk;
88  m_pTransverseMercatorExact->Reverse( lon0, x, y, llat, llon,
89  lgamma, lk );
90  lat = llat;
91  lon = llon;
92  gamma = lgamma;
93  k = lk;
94 }
95 
96 //*****************************************************************************
97 void TransverseMercatorExact::Forward(double lon0, double lat, double lon,
98  [System::Runtime::InteropServices::Out] double% x,
99  [System::Runtime::InteropServices::Out] double% y)
100 {
101  double lx, ly;
103  x = lx;
104  y = ly;
105 }
106 
107 //*****************************************************************************
108 void TransverseMercatorExact::Reverse(double lon0, double x, double y,
109  [System::Runtime::InteropServices::Out] double% lat,
110  [System::Runtime::InteropServices::Out] double% lon)
111 {
112  double llat, llon;
113  m_pTransverseMercatorExact->Reverse( lon0, x, y, llat, llon );
114  lat = llat;
115  lon = llon;
116 }
117 
118 //*****************************************************************************
120 { return m_pTransverseMercatorExact->MajorRadius(); }
121 
122 //*****************************************************************************
124 { return m_pTransverseMercatorExact->Flattening(); }
125 
126 //*****************************************************************************
128 { return m_pTransverseMercatorExact->CentralScale(); }
GeographicLib::TransverseMercatorExact
An exact implementation of the transverse Mercator projection.
Definition: TransverseMercatorExact.hpp:83
NETGeographicLib::TransverseMercatorExact::TransverseMercatorExact
TransverseMercatorExact()
Definition: dotnet/NETGeographicLib/TransverseMercatorExact.cpp:50
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
TransverseMercatorExact.h
Header for NETGeographicLib::TransverseMercatorExact class.
NETGeographicLib::GeographicErr
Exception class for NETGeographicLib.
Definition: NETGeographicLib.h:132
GeographicLib::TransverseMercatorExact::Reverse
void Reverse(real lon0, real x, real y, real &lat, real &lon, real &gamma, real &k) const
Definition: src/TransverseMercatorExact.cpp:408
k0
double k0(double x)
Definition: k0.c:131
lgamma
const EIGEN_DEVICE_FUNC LgammaReturnType lgamma() const
Definition: ArrayCwiseUnaryOps.h:620
example::lon0
const double lon0
Definition: testGPSFactor.cpp:41
NETGeographicLib::TransverseMercatorExact
.NET wrapper for GeographicLib::TransverseMercatorExact.
Definition: TransverseMercatorExact.h:84
stdafx.h
gamma
#define gamma
Definition: mconf.h:85
NETGeographicLib.h
Header for NETGeographicLib::NETGeographicLib objects.
y
Scalar * y
Definition: level1_cplx_impl.h:124
NETGeographicLib::TransverseMercatorExact::Forward
void Forward(double lon0, double lat, double lon, [System::Runtime::InteropServices::Out] double% x, [System::Runtime::InteropServices::Out] double% y, [System::Runtime::InteropServices::Out] double% gamma, [System::Runtime::InteropServices::Out] double% k)
Definition: dotnet/NETGeographicLib/TransverseMercatorExact.cpp:65
NETGeographicLib::TransverseMercatorExact::m_pTransverseMercatorExact
GeographicLib::TransverseMercatorExact * m_pTransverseMercatorExact
Definition: TransverseMercatorExact.h:88
tree::f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Definition: testExpression.cpp:218
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
GeographicLib::TransverseMercatorExact::Forward
void Forward(real lon0, real lat, real lon, real &x, real &y, real &gamma, real &k) const
Definition: src/TransverseMercatorExact.cpp:348
NETGeographicLib::TransverseMercatorExact::Reverse
void Reverse(double lon0, double x, double y, [System::Runtime::InteropServices::Out] double% lat, [System::Runtime::InteropServices::Out] double% lon, [System::Runtime::InteropServices::Out] double% gamma, [System::Runtime::InteropServices::Out] double% k)
Definition: dotnet/NETGeographicLib/TransverseMercatorExact.cpp:81
BADALLOC
const char BADALLOC[]
Definition: dotnet/NETGeographicLib/TransverseMercatorExact.cpp:18
lon
static const double lon
Definition: testGeographicLib.cpp:34
NULL
#define NULL
Definition: ccolamd.c:609
GeographicLib::TransverseMercatorExact::UTM
static const TransverseMercatorExact & UTM()
Definition: src/TransverseMercatorExact.cpp:78
get
Container::iterator get(Container &c, Position position)
Definition: stdlist_overload.cpp:29
NETGeographicLib
Definition: Accumulator.h:13
TransverseMercatorExact.hpp
Header for GeographicLib::TransverseMercatorExact class.
lat
static const double lat
Definition: testGeographicLib.cpp:34


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