dotnet/examples/ManagedCPP/example-RhumbLine.cpp
Go to the documentation of this file.
1 using namespace System;
2 using namespace NETGeographicLib;
3 
5 {
6  try {
7  // Print waypoints between JFK and SIN
8  Rhumb^ rhumb = gcnew Rhumb(Constants::WGS84::MajorRadius, Constants::WGS84::Flattening, true);
9  // Alternatively: const Rhumb& rhumb = Rhumb::WGS84();
10  double
11  lat1 = 40.640, lon1 = -73.779, // JFK
12  lat2 = 1.359, lon2 = 103.989; // SIN
13  double s12, azi12;
14  rhumb->Inverse(lat1, lon1, lat2, lon2, s12, azi12);
15  RhumbLine^ line = rhumb->Line(lat1, lon1, azi12);
16  // Alternatively
17  // const GeographicLib::RhumbLine line = rhumb.Line(lat1, lon1, azi1);
18  double ds0 = 500e3; // Nominal distance between points = 500 km
19  int num = int(Math::Ceiling(s12 / ds0)); // The number of intervals
20  {
21  // Use intervals of equal length
22  double ds = s12 / num;
23  for (int i = 0; i <= num; ++i) {
24  double lat, lon;
25  line->Position(i * ds, lat, lon);
26  Console::WriteLine( "{0} {1} {2}", i, lat, lon );
27  }
28  }
29  }
30  catch (GeographicErr^ e) {
31  Console::WriteLine(String::Format("Caught exception: {0}", e->Message));
32  return -1;
33  }
34  return 0;
35 }
gtsam.examples.DogLegOptimizerExample.int
int
Definition: DogLegOptimizerExample.py:111
main
int main(array< System::String ^> ^)
Definition: dotnet/examples/ManagedCPP/example-RhumbLine.cpp:4
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
NETGeographicLib::Rhumb::Line
RhumbLine Line(double lat1, double lon1, double azi12)
Definition: dotnet/NETGeographicLib/Rhumb.cpp:124
NETGeographicLib::GeographicErr
Exception class for NETGeographicLib.
Definition: NETGeographicLib.h:132
NETGeographicLib::Rhumb::Inverse
void Inverse(double lat1, double lon1, double lat2, double lon2, [System::Runtime::InteropServices::Out] double% s12, [System::Runtime::InteropServices::Out] double% azi12, [System::Runtime::InteropServices::Out] double% S12)
Definition: dotnet/NETGeographicLib/Rhumb.cpp:85
NETGeographicLib::RhumbLine::Position
void Position(double s12, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2, [System::Runtime::InteropServices::Out] double% S12)
Definition: dotnet/NETGeographicLib/Rhumb.cpp:172
array
Definition: numpy.h:821
NETGeographicLib::Rhumb
.NET wrapper for GeographicLib::Rhumb.
Definition: Rhumb.h:65
lon
static const double lon
Definition: testGeographicLib.cpp:34
NETGeographicLib
Definition: Accumulator.h:13
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
lat
static const double lat
Definition: testGeographicLib.cpp:34
NETGeographicLib::RhumbLine
.NET wrapper for GeographicLib::RhumbLine.
Definition: Rhumb.h:374


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