dotnet/examples/ManagedCPP/example-MagneticCircle.cpp
Go to the documentation of this file.
1 using namespace System;
2 using namespace NETGeographicLib;
3 
5 {
6  try {
7  MagneticModel^ mag = gcnew MagneticModel("wmm2010","");
8  double lat = 27.99, lon0 = 86.93, h = 8820, t = 2012; // Mt Everest
9  {
10  // Slow method of evaluating the values at several points on a circle of
11  // latitude.
12  for (int i = -5; i <= 5; ++i) {
13  double lon = lon0 + i * 0.2;
14  double Bx, By, Bz;
15  mag->Field(t, lat, lon, h, Bx, By, Bz);
16  Console::WriteLine(String::Format("{0} {1} {2} {3}", lon, Bx, By, Bz));
17  }
18  }
19  {
20  // Fast method of evaluating the values at several points on a circle of
21  // latitude using MagneticCircle.
22  MagneticCircle^ circ = mag->Circle(t, lat, h);
23  for (int i = -5; i <= 5; ++i) {
24  double lon = lon0 + i * 0.2;
25  double Bx, By, Bz;
26  circ->Field(lon, Bx, By, Bz);
27  Console::WriteLine(String::Format("{0} {1} {2} {3}", lon, Bx, By, Bz));
28  }
29  }
30  }
31  catch (GeographicErr^ e) {
32  Console::WriteLine(String::Format("Caught exception: {0}", e->Message));
33  return -1;
34  }
35  return 0;
36 }
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
h
const double h
Definition: testSimpleHelicopter.cpp:19
NETGeographicLib::GeographicErr
Exception class for NETGeographicLib.
Definition: NETGeographicLib.h:132
example::lon0
const double lon0
Definition: testGPSFactor.cpp:41
NETGeographicLib::MagneticModel
.NET wrapper for GeographicLib::MagneticModel.
Definition: MagneticModel.h:63
NETGeographicLib::MagneticCircle::Field
void Field(double lon, [System::Runtime::InteropServices::Out] double% Bx, [System::Runtime::InteropServices::Out] double% By, [System::Runtime::InteropServices::Out] double% Bz)
Definition: dotnet/NETGeographicLib/MagneticCircle.cpp:42
array
Definition: numpy.h:821
NETGeographicLib::MagneticCircle
.NET wrapper for GeographicLib::MagneticCircle.
Definition: MagneticCircle.h:41
main
int main(array< System::String ^> ^)
Definition: dotnet/examples/ManagedCPP/example-MagneticCircle.cpp:4
lon
static const double lon
Definition: testGeographicLib.cpp:34
align_3::t
Point2 t(10, 10)
NETGeographicLib
Definition: Accumulator.h:13
NETGeographicLib::MagneticModel::Field
void Field(double t, double lat, double lon, double h, [System::Runtime::InteropServices::Out] double% Bx, [System::Runtime::InteropServices::Out] double% By, [System::Runtime::InteropServices::Out] double% Bz)
Definition: dotnet/NETGeographicLib/MagneticModel.cpp:88
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
NETGeographicLib::MagneticModel::Circle
MagneticCircle Circle(double t, double lat, double h)
Definition: dotnet/NETGeographicLib/MagneticModel.cpp:120
lat
static const double lat
Definition: testGeographicLib.cpp:34


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:31