dotnet/examples/ManagedCPP/example-EllipticFunction.cpp
Go to the documentation of this file.
1 using namespace System;
2 using namespace NETGeographicLib;
3 
5 {
6  try {
7  EllipticFunction^ ell = gcnew EllipticFunction(0.1, 1.0); // parameter m = 0.1
8  // See Abramowitz and Stegun, table 17.1
9  Console::WriteLine( String::Format( "{0} {1}", ell->K(), ell->E()));
10  double phi = 20 * Math::Acos(-1.0) / 180.0;;
11  // See Abramowitz and Stegun, table 17.6 with
12  // alpha = asin(sqrt(m)) = 18.43 deg and phi = 20 deg
13  Console::WriteLine( String::Format("{0} {1}", ell->E(phi),
14  ell->E(Math::Sin(phi), Math::Cos(phi),
15  Math::Sqrt(1 - ell->k2 * Math::Sin(phi) * Math::Sin(phi))) ) );
16  // See Carlson 1995, Sec 3.
17  Console::WriteLine(String::Format("RF(1,2,0) = {0}", EllipticFunction::RF(1,2)));
18  Console::WriteLine(String::Format("RF(2,3,4) = {0}", EllipticFunction::RF(2,3,4)));
19  Console::WriteLine(String::Format("RC(0,1/4) = {0}", EllipticFunction::RC(0,0.25)));
20  Console::WriteLine(String::Format("RC(9/4,2) = {0}", EllipticFunction::RC(2.25,2)));
21  Console::WriteLine(String::Format("RC(1/4,-2) = {0}", EllipticFunction::RC(0.25,-2)));
22  Console::WriteLine(String::Format("RJ(0,1,2,3) = {0}", EllipticFunction::RJ(0,1,2,3)));
23  Console::WriteLine(String::Format("RJ(2,3,4,5) = {0}", EllipticFunction::RJ(2,3,4,5)));
24  Console::WriteLine(String::Format("RD(0,2,1) = {0}", EllipticFunction::RD(0,2,1)));
25  Console::WriteLine(String::Format("RD(2,3,4) = {0}", EllipticFunction::RD(2,3,4)));
26  Console::WriteLine(String::Format("RG(0,16,16) = {0}", EllipticFunction::RG(16,16)));
27  Console::WriteLine(String::Format("RG(2,3,4) = {0}", EllipticFunction::RG(2,3,4)));
28  Console::WriteLine(String::Format("RG(0,0.0796,4) = {0}", EllipticFunction::RG(0.0796, 4)));
29  }
30  catch (GeographicErr^ e) {
31  Console::WriteLine( String::Format( "Caught exception: {0}", e->Message ) );
32  return -1;
33  }
34  return 0;
35 }
Exception class for NETGeographicLib.
Definition: numpy.h:543
.NET wrapper for GeographicLib::EllipticFunction.
int main(array< System::String^>^)
Array< double, 1, 3 > e(1./3., 0.5, 2.)


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