00001 #pragma once 00002 /** 00003 * \file NETGeographicLib/MagneticCircle.h 00004 * \brief Header for NETGeographicLib::MagneticCircle class 00005 * 00006 * NETGeographicLib is copyright (c) Scott Heiman (2013) 00007 * GeographicLib is Copyright (c) Charles Karney (2010-2012) 00008 * <charles@karney.com> and licensed under the MIT/X11 License. 00009 * For more information, see 00010 * http://geographiclib.sourceforge.net/ 00011 **********************************************************************/ 00012 00013 namespace NETGeographicLib 00014 { 00015 /** 00016 * \brief .NET wrapper for GeographicLib::MagneticCircle. 00017 * 00018 * This class allows .NET applications to access GeographicLib::MagneticCircle. 00019 * 00020 * Evaluate the earth's magnetic field on a circle of constant height and 00021 * latitude. This uses a CircularEngine to pre-evaluate the inner sum of the 00022 * spherical harmonic sum, allowing the values of the field at several 00023 * different longitudes to be evaluated rapidly. 00024 * 00025 * Use MagneticModel::Circle to create a MagneticCircle object. (The 00026 * constructor for this class is for internal use only.) 00027 * 00028 * C# Example: 00029 * \include example-MagneticCircle.cs 00030 * Managed C++ Example: 00031 * \include example-MagneticCircle.cpp 00032 * Visual Basic Example: 00033 * \include example-MagneticCircle.vb 00034 * 00035 * <B>INTERFACE DIFFERENCES:</B><BR> 00036 * The () operator has been replaced with Field. 00037 * 00038 * The following functions are implemented as properties: 00039 * Init, MajorRadius, Flattening, Latitude, Height, and Time. 00040 **********************************************************************/ 00041 public ref class MagneticCircle 00042 { 00043 private: 00044 // pointer to the unmanaged GeographicLib::MagneticCircle. 00045 const GeographicLib::MagneticCircle* m_pMagneticCircle; 00046 00047 // the finalizer frees the unmanaged memory when the object is destroyed. 00048 !MagneticCircle(void); 00049 public: 00050 00051 /** 00052 * %brief A constructor that is initialized from an unmanaged 00053 * GeographicLib::MagneticCircle. This is for internal use only. 00054 * 00055 * Developers should use MagneticModel::Circle to create a 00056 * MagneticCircle. 00057 **********************************************************************/ 00058 MagneticCircle( const GeographicLib::MagneticCircle& c ); 00059 00060 /** 00061 * %brief The destructor calls the finalizer. 00062 **********************************************************************/ 00063 ~MagneticCircle() 00064 { this->!MagneticCircle(); } 00065 00066 /** \name Compute the magnetic field 00067 **********************************************************************/ 00068 ///@{ 00069 /** 00070 * %brief Evaluate the components of the geomagnetic field at a 00071 * particular longitude. 00072 * 00073 * @param[in] lon longitude of the point (degrees). 00074 * @param[out] Bx the easterly component of the magnetic field (nanotesla). 00075 * @param[out] By the northerly component of the magnetic field (nanotesla). 00076 * @param[out] Bz the vertical (up) component of the magnetic field 00077 * (nanotesla). 00078 **********************************************************************/ 00079 void Field(double lon, 00080 [System::Runtime::InteropServices::Out] double% Bx, 00081 [System::Runtime::InteropServices::Out] double% By, 00082 [System::Runtime::InteropServices::Out] double% Bz); 00083 00084 /** 00085 * Evaluate the components of the geomagnetic field and their time 00086 * derivatives at a particular longitude. 00087 * 00088 * @param[in] lon longitude of the point (degrees). 00089 * @param[out] Bx the easterly component of the magnetic field (nanotesla). 00090 * @param[out] By the northerly component of the magnetic field (nanotesla). 00091 * @param[out] Bz the vertical (up) component of the magnetic field 00092 * (nanotesla). 00093 * @param[out] Bxt the rate of change of \e Bx (nT/yr). 00094 * @param[out] Byt the rate of change of \e By (nT/yr). 00095 * @param[out] Bzt the rate of change of \e Bz (nT/yr). 00096 **********************************************************************/ 00097 void Field(double lon, 00098 [System::Runtime::InteropServices::Out] double% Bx, 00099 [System::Runtime::InteropServices::Out] double% By, 00100 [System::Runtime::InteropServices::Out] double% Bz, 00101 [System::Runtime::InteropServices::Out] double% Bxt, 00102 [System::Runtime::InteropServices::Out] double% Byt, 00103 [System::Runtime::InteropServices::Out] double% Bzt); 00104 ///@} 00105 00106 /** \name Inspector functions 00107 **********************************************************************/ 00108 ///@{ 00109 /** 00110 * @return true if the object has been initialized. 00111 **********************************************************************/ 00112 property bool Init { bool get(); } 00113 /** 00114 * @return \e a the equatorial radius of the ellipsoid (meters). This is 00115 * the value inherited from the MagneticModel object used in the 00116 * constructor. This property throws a GeographicErr exception if 00117 * the object is not initialized. 00118 **********************************************************************/ 00119 property double MajorRadius { double get(); } 00120 /** 00121 * @return \e f the flattening of the ellipsoid. This is the value 00122 * inherited from the MagneticModel object used in the constructor. 00123 * This property throws a GeographicErr exception if the object is 00124 * not initialized. 00125 **********************************************************************/ 00126 property double Flattening { double get(); } 00127 /** 00128 * @return the latitude of the circle (degrees). 00129 * This property throws a GeographicErr exception if the object is 00130 * not initialized. 00131 **********************************************************************/ 00132 property double Latitude { double get(); } 00133 /** 00134 * @return the height of the circle (meters). 00135 * This property throws a GeographicErr exception if the object is 00136 * not initialized. 00137 **********************************************************************/ 00138 property double Height { double get(); } 00139 /** 00140 * @return the time (fractional years). 00141 * This property throws a GeographicErr exception if the object is 00142 * not initialized. 00143 **********************************************************************/ 00144 property double Time { double get(); } 00145 ///@} 00146 }; 00147 } //namespace NETGeographicLib