Public Member Functions | Private Member Functions | Private Attributes | List of all members
NETGeographicLib::MagneticCircle Class Reference

.NET wrapper for GeographicLib::MagneticCircle. More...

#include <MagneticCircle.h>

Public Member Functions

 MagneticCircle (const GeographicLib::MagneticCircle &c)
 
 ~MagneticCircle ()
 
Compute the magnetic field
void Field (double lon, [System::Runtime::InteropServices::Out] double% Bx, [System::Runtime::InteropServices::Out] double% By, [System::Runtime::InteropServices::Out] double% Bz)
 
void Field (double lon, [System::Runtime::InteropServices::Out] double% Bx, [System::Runtime::InteropServices::Out] double% By, [System::Runtime::InteropServices::Out] double% Bz, [System::Runtime::InteropServices::Out] double% Bxt, [System::Runtime::InteropServices::Out] double% Byt, [System::Runtime::InteropServices::Out] double% Bzt)
 

Public Attributes

Inspector functions
property bool Init { bool get()
 
property double MajorRadius { double get()
 
property double Flattening { double get()
 
property double Latitude { double get()
 
property double Height { double get()
 
property double Time { double get()
 

Private Member Functions

 !MagneticCircle (void)
 

Private Attributes

const GeographicLib::MagneticCirclem_pMagneticCircle
 

Detailed Description

.NET wrapper for GeographicLib::MagneticCircle.

This class allows .NET applications to access GeographicLib::MagneticCircle.

Evaluate the earth's magnetic field on a circle of constant height and latitude. This uses a CircularEngine to pre-evaluate the inner sum of the spherical harmonic sum, allowing the values of the field at several different longitudes to be evaluated rapidly.

Use MagneticModel::Circle to create a MagneticCircle object. (The constructor for this class is for internal use only.)

C# Example:

using System;
namespace example_MagneticCircle
{
class Program
{
static void Main(string[] args)
{
try {
MagneticModel mag = new MagneticModel("wmm2010","");
double lat = 27.99, lon0 = 86.93, h = 8820, t = 2012; // Mt Everest
{
// Slow method of evaluating the values at several points on a circle of
// latitude.
for (int i = -5; i <= 5; ++i) {
double lon = lon0 + i * 0.2;
double Bx, By, Bz;
mag.Field(t, lat, lon, h, out Bx, out By, out Bz);
Console.WriteLine(String.Format("{0} {1} {2} {3}", lon, Bx, By, Bz));
}
}
{
// Fast method of evaluating the values at several points on a circle of
// latitude using MagneticCircle.
MagneticCircle circ = mag.Circle(t, lat, h);
for (int i = -5; i <= 5; ++i) {
double lon = lon0 + i * 0.2;
double Bx, By, Bz;
circ.Field(lon, out Bx, out By, out Bz);
Console.WriteLine(String.Format("{0} {1} {2} {3}", lon, Bx, By, Bz));
}
}
}
catch (GeographicErr e) {
Console.WriteLine(String.Format("Caught exception: {0}", e.Message));
}
}
}
}

Managed C++ Example:

// Example of using the GeographicLib::MagneticCircle class
#include <iostream>
#include <exception>
using namespace std;
using namespace GeographicLib;
int main() {
try {
MagneticModel mag("wmm2010");
double lat = 27.99, lon0 = 86.93, h = 8820, t = 2012; // Mt Everest
{
// Slow method of evaluating the values at several points on a circle of
// latitude.
for (int i = -5; i <= 5; ++i) {
double lon = lon0 + i * 0.2;
double Bx, By, Bz;
mag(t, lat, lon, h, Bx, By, Bz);
cout << lon << " " << Bx << " " << By << " " << Bz << "\n";
}
}
{
// Fast method of evaluating the values at several points on a circle of
// latitude using MagneticCircle.
MagneticCircle circ = mag.Circle(t, lat, h);
for (int i = -5; i <= 5; ++i) {
double lon = lon0 + i * 0.2;
double Bx, By, Bz;
circ(lon, Bx, By, Bz);
cout << lon << " " << Bx << " " << By << " " << Bz << "\n";
}
}
}
catch (const exception& e) {
cerr << "Caught exception: " << e.what() << "\n";
return 1;
}
}

Visual Basic Example:

Imports NETGeographicLib
Module example_MagneticCircle
Sub Main()
Try
Dim mag As MagneticModel = New MagneticModel("wmm2010", "")
Dim lat As Double = 27.99, lon0 = 86.93, h = 8820, t = 2012 ' Mt Everest
' Slow method of evaluating the values at several points on a circle of
' latitude.
For i As Integer = -5 To 5
Dim lon As Double = lon0 + i * 0.2
Dim Bx, By, Bz As Double
mag.Field(t, lat, lon, h, Bx, By, Bz)
Console.WriteLine(String.Format("{0} {1} {2} {3}", lon, Bx, By, Bz))
Next
' Fast method of evaluating the values at several points on a circle of
' latitude using MagneticCircle.
Dim circ As MagneticCircle = mag.Circle(t, lat, h)
For i As Integer = -5 To 5
Dim lon As Double = lon0 + i * 0.2
Dim Bx, By, Bz As Double
circ.Field(lon, Bx, By, Bz)
Console.WriteLine(String.Format("{0} {1} {2} {3}", lon, Bx, By, Bz))
Next
Catch ex As GeographicErr
Console.WriteLine(String.Format("Caught exception: {0}", ex.Message))
End Try
End Sub
End Module

INTERFACE DIFFERENCES:
The () operator has been replaced with Field.

The following functions are implemented as properties: Init, MajorRadius, Flattening, Latitude, Height, and Time.

Definition at line 41 of file MagneticCircle.h.

Constructor & Destructor Documentation

◆ !MagneticCircle()

MagneticCircle::!MagneticCircle ( void  )
private

Definition at line 19 of file dotnet/NETGeographicLib/MagneticCircle.cpp.

◆ MagneticCircle()

MagneticCircle::MagneticCircle ( const GeographicLib::MagneticCircle c)

brief A constructor that is initialized from an unmanaged GeographicLib::MagneticCircle. This is for internal use only.

Developers should use MagneticModel::Circle to create a MagneticCircle.

Definition at line 29 of file dotnet/NETGeographicLib/MagneticCircle.cpp.

◆ ~MagneticCircle()

NETGeographicLib::MagneticCircle::~MagneticCircle ( )
inline

brief The destructor calls the finalizer.

Definition at line 63 of file MagneticCircle.h.

Member Function Documentation

◆ Field() [1/2]

void MagneticCircle::Field ( double  lon,
[System::Runtime::InteropServices::Out] double%  Bx,
[System::Runtime::InteropServices::Out] double%  By,
[System::Runtime::InteropServices::Out] double%  Bz 
)

brief Evaluate the components of the geomagnetic field at a particular longitude.

Parameters
[in]lonlongitude of the point (degrees).
[out]Bxthe easterly component of the magnetic field (nanotesla).
[out]Bythe northerly component of the magnetic field (nanotesla).
[out]Bzthe vertical (up) component of the magnetic field (nanotesla).

Definition at line 42 of file dotnet/NETGeographicLib/MagneticCircle.cpp.

◆ Field() [2/2]

void MagneticCircle::Field ( double  lon,
[System::Runtime::InteropServices::Out] double%  Bx,
[System::Runtime::InteropServices::Out] double%  By,
[System::Runtime::InteropServices::Out] double%  Bz,
[System::Runtime::InteropServices::Out] double%  Bxt,
[System::Runtime::InteropServices::Out] double%  Byt,
[System::Runtime::InteropServices::Out] double%  Bzt 
)

Evaluate the components of the geomagnetic field and their time derivatives at a particular longitude.

Parameters
[in]lonlongitude of the point (degrees).
[out]Bxthe easterly component of the magnetic field (nanotesla).
[out]Bythe northerly component of the magnetic field (nanotesla).
[out]Bzthe vertical (up) component of the magnetic field (nanotesla).
[out]Bxtthe rate of change of Bx (nT/yr).
[out]Bytthe rate of change of By (nT/yr).
[out]Bztthe rate of change of Bz (nT/yr).

Definition at line 55 of file dotnet/NETGeographicLib/MagneticCircle.cpp.

Member Data Documentation

◆ Flattening

property double NETGeographicLib::MagneticCircle::Flattening { double get()
Returns
f the flattening of the ellipsoid. This is the value inherited from the MagneticModel object used in the constructor. This property throws a GeographicErr exception if the object is not initialized.

Definition at line 126 of file MagneticCircle.h.

◆ Height

property double NETGeographicLib::MagneticCircle::Height { double get()
Returns
the height of the circle (meters). This property throws a GeographicErr exception if the object is not initialized.

Definition at line 138 of file MagneticCircle.h.

◆ Init

property bool NETGeographicLib::MagneticCircle::Init { bool get()
Returns
true if the object has been initialized.

Definition at line 112 of file MagneticCircle.h.

◆ Latitude

property double NETGeographicLib::MagneticCircle::Latitude { double get()
Returns
the latitude of the circle (degrees). This property throws a GeographicErr exception if the object is not initialized.

Definition at line 132 of file MagneticCircle.h.

◆ m_pMagneticCircle

const GeographicLib::MagneticCircle* NETGeographicLib::MagneticCircle::m_pMagneticCircle
private

Definition at line 45 of file MagneticCircle.h.

◆ MajorRadius

property double NETGeographicLib::MagneticCircle::MajorRadius { double get()
Returns
a the equatorial radius of the ellipsoid (meters). This is the value inherited from the MagneticModel object used in the constructor. This property throws a GeographicErr exception if the object is not initialized.

Definition at line 119 of file MagneticCircle.h.

◆ Time

property double NETGeographicLib::MagneticCircle::Time { double get()
Returns
the time (fractional years). This property throws a GeographicErr exception if the object is not initialized.

Definition at line 144 of file MagneticCircle.h.


The documentation for this class was generated from the following files:
MagneticModel.hpp
Header for GeographicLib::MagneticModel class.
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
GeographicLib::MagneticModel
Model of the earth's magnetic field.
Definition: MagneticModel.hpp:69
h
const double h
Definition: testSimpleHelicopter.cpp:19
main
int main(int argc, char **argv)
Definition: cmake/example_cmake_find_gtsam/main.cpp:63
example::lon0
const double lon0
Definition: testGPSFactor.cpp:41
NETGeographicLib::MagneticCircle::MagneticCircle
MagneticCircle(const GeographicLib::MagneticCircle &c)
Definition: dotnet/NETGeographicLib/MagneticCircle.cpp:29
out
std::ofstream out("Result.txt")
MagneticCircle.hpp
Header for GeographicLib::MagneticCircle class.
std
Definition: BFloat16.h:88
args
Definition: pytypes.h:2210
lon
static const double lon
Definition: testGeographicLib.cpp:34
align_3::t
Point2 t(10, 10)
NETGeographicLib
Definition: Accumulator.h:13
GeographicLib::MagneticCircle
Geomagnetic field on a circle of latitude.
Definition: MagneticCircle.hpp:37
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
lat
static const double lat
Definition: testGeographicLib.cpp:34


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:16:46