dotnet/NETGeographicLib/OSGB.cpp
Go to the documentation of this file.
1 
11 #include "stdafx.h"
12 #include "GeographicLib/OSGB.hpp"
13 #include "OSGB.h"
14 #include "NETGeographicLib.h"
15 
16 using namespace NETGeographicLib;
17 
18 //*****************************************************************************
19 void OSGB::Forward(double lat, double lon,
20  [System::Runtime::InteropServices::Out] double% x,
21  [System::Runtime::InteropServices::Out] double% y,
22  [System::Runtime::InteropServices::Out] double% gamma,
23  [System::Runtime::InteropServices::Out] double% k)
24 {
25  double lx, ly, lgamma, lk;
26  GeographicLib::OSGB::Forward( lat, lon, lx, ly, lgamma, lk );
27  x = lx;
28  y = ly;
29  gamma = lgamma;
30  k = lk;
31 }
32 
33 //*****************************************************************************
34 void OSGB::Reverse(double x, double y,
35  [System::Runtime::InteropServices::Out] double% lat,
36  [System::Runtime::InteropServices::Out] double% lon,
37  [System::Runtime::InteropServices::Out] double% gamma,
38  [System::Runtime::InteropServices::Out] double% k)
39 {
40  double llat, llon, lgamma, lk;
41  GeographicLib::OSGB::Reverse( x, y, llat, llon, lgamma, lk );
42  lat = llat;
43  lon = llon;
44  gamma = lgamma;
45  k = lk;
46 }
47 
48 //*****************************************************************************
49 void OSGB::Forward(double lat, double lon,
50  [System::Runtime::InteropServices::Out] double% x,
51  [System::Runtime::InteropServices::Out] double% y)
52 {
53  double lx, ly;
54  GeographicLib::OSGB::Forward( lat, lon, lx, ly );
55  x = lx;
56  y = ly;
57 }
58 
59 //*****************************************************************************
60 void OSGB::Reverse(double x, double y,
61  [System::Runtime::InteropServices::Out] double% lat,
62  [System::Runtime::InteropServices::Out] double% lon)
63 {
64  double llat, llon;
65  GeographicLib::OSGB::Reverse( x, y, llat, llon );
66  lat = llat;
67  lon = llon;
68 }
69 
70 //*****************************************************************************
71 void OSGB::GridReference(double x, double y, int prec,
72  [System::Runtime::InteropServices::Out] System::String^% gridref)
73 {
74  try
75  {
76  std::string lgridref;
77  GeographicLib::OSGB::GridReference( x, y, prec, lgridref );
78  gridref = gcnew System::String( lgridref.c_str() );
79  }
80  catch ( std::bad_alloc )
81  {
82  throw gcnew GeographicErr( "Memory allocation error in OSGB::GridReference" );
83  }
84  catch ( const std::exception& err )
85  {
86  throw gcnew GeographicErr( err.what() );
87  }
88 }
89 
90 //*****************************************************************************
91 void OSGB::GridReference(System::String^ gridref,
92  [System::Runtime::InteropServices::Out] double% x,
93  [System::Runtime::InteropServices::Out] double% y,
94  [System::Runtime::InteropServices::Out] int% prec,
95  bool centerp )
96 {
97  try
98  {
99  double lx, ly;
100  int lprec;
103  lx, ly, lprec, centerp );
104  x = lx;
105  y = ly;
106  prec = lprec;
107  }
108  catch ( const std::exception& err )
109  {
110  throw gcnew GeographicErr( err.what() );
111  }
112 }
113 
114 //*****************************************************************************
116 
117 //*****************************************************************************
119 
120 //*****************************************************************************
122 
123 //*****************************************************************************
125 
126 //*****************************************************************************
129 
130 //*****************************************************************************
132 
133 //*****************************************************************************
static void Forward(real lat, real lon, real &x, real &y, real &gamma, real &k)
Definition: OSGB.hpp:81
static void Forward(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)
Header for NETGeographicLib::NETGeographicLib objects.
Scalar * y
static const double lat
Exception class for NETGeographicLib.
static Math::real Flattening()
Definition: OSGB.hpp:205
static std::string ManagedToUnmanaged(System::String^s)
static Math::real FalseEasting()
Definition: OSGB.hpp:238
static Math::real OriginLatitude()
Definition: OSGB.hpp:222
Header for GeographicLib::OSGB class.
static void Reverse(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)
static Math::real CentralScale()
Definition: OSGB.hpp:214
const mpreal gamma(const mpreal &x, mp_rnd_t r=mpreal::get_default_rnd())
Definition: mpreal.h:2262
static Math::real FalseNorthing()
Definition: OSGB.hpp:233
static Math::real OriginLongitude()
Definition: OSGB.hpp:228
static Math::real MajorRadius()
Definition: OSGB.hpp:190
static void Reverse(real x, real y, real &lat, real &lon, real &gamma, real &k)
Definition: OSGB.hpp:102
static void GridReference(double x, double y, int prec, [System::Runtime::InteropServices::Out] System::String^%gridref)
Header for NETGeographicLib::OSGB class.
static void GridReference(real x, real y, int prec, std::string &gridref)
Definition: src/OSGB.cpp:34
static const double lon
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
EIGEN_DEVICE_FUNC const LgammaReturnType lgamma() const


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:43:06