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;
72  m_pTransverseMercatorExact->Forward( lon0, lat, lon, lx, ly,
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;
102  m_pTransverseMercatorExact->Forward( lon0, lat, lon, 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 //*****************************************************************************
121 
122 //*****************************************************************************
125 
126 //*****************************************************************************
Header for NETGeographicLib::NETGeographicLib objects.
static const TransverseMercatorExact & UTM()
Scalar * y
An exact implementation of the transverse Mercator projection.
static const double lat
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)
Exception class for NETGeographicLib.
Header for GeographicLib::TransverseMercatorExact class.
Header for NETGeographicLib::TransverseMercatorExact class.
void Reverse(real lon0, real x, real y, real &lat, real &lon, real &gamma, real &k) const
EIGEN_DEVICE_FUNC const LgammaReturnType lgamma() const
GeographicLib::TransverseMercatorExact * m_pTransverseMercatorExact
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
.NET wrapper for GeographicLib::TransverseMercatorExact.
const double lon0
#define NULL
Definition: ccolamd.c:609
void Forward(real lon0, real lat, real lon, real &x, real &y, real &gamma, real &k) const
static const double lon
Container::iterator get(Container &c, Position position)
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
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)


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:40:26