dotnet/examples/ManagedCPP/example-CircularEngine.cpp
Go to the documentation of this file.
1 using namespace System;
2 using namespace NETGeographicLib;
3 
5 {
6  // This computes the same value as example-SphericalHarmonic.cpp using a
7  // CircularEngine (which will be faster if many values on a circle of
8  // latitude are to be found).
9  try {
10  int N = 3; // The maxium degree
11  array<double>^ ca = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; // cosine coefficients
12  array<double>^ sa = {6, 5, 4, 3, 2, 1}; // sine coefficients
13  double a = 1;
14  SphericalHarmonic^ h = gcnew SphericalHarmonic(ca, sa, N, a, SphericalHarmonic::Normalization::SCHMIDT);
15  double x = 2, y = 3, z = 1, p = Math::Sqrt(x*x+y*y);
16  CircularEngine^ circ = h->Circle(p, z, true);
17  double v, vx, vy, vz;
18  v = circ->LongitudeSum(x/p, y/p, vx, vy, vz);
19  Console::WriteLine(String::Format("{0} {1} {2} {3}", v, vx, vy, vz));
20  }
21  catch (GeographicErr^ e) {
22  Console::WriteLine(String::Format("Caught exception: {0}", e->Message));
23  return -1;
24  }
25  return 0;
26 }
NETGeographicLib::SphericalHarmonic
.NET wrapper for GeographicLib::SphericalHarmonic.
Definition: SphericalHarmonic.h:75
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
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
h
const double h
Definition: testSimpleHelicopter.cpp:19
NETGeographicLib::GeographicErr
Exception class for NETGeographicLib.
Definition: NETGeographicLib.h:132
vy
StridedVectorType vy(make_vector(y, *n, std::abs(*incy)))
pybind_wrapper_test_script.z
z
Definition: pybind_wrapper_test_script.py:61
NETGeographicLib::CircularEngine
.NET wrapper for GeographicLib::CircularEngine.
Definition: CircularEngine.h:54
y
Scalar * y
Definition: level1_cplx_impl.h:124
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
array
Definition: numpy.h:821
p
float * p
Definition: Tutorial_Map_using.cpp:9
v
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
NETGeographicLib::CircularEngine::LongitudeSum
double LongitudeSum(double coslon, double sinlon)
Definition: dotnet/NETGeographicLib/CircularEngine.cpp:46
N
#define N
Definition: igam.h:9
main
int main(array< System::String ^> ^)
Definition: dotnet/examples/ManagedCPP/example-CircularEngine.cpp:4
NETGeographicLib
Definition: Accumulator.h:13
vx
StridedVectorType vx(make_vector(x, *n, std::abs(*incx)))


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