00001 #pragma once 00002 /** 00003 * \file NETGeographicLib/GravityCircle.h 00004 * \brief Header for NETGeographicLib::GravityCircle 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::GravityCircle. 00017 * 00018 * This class allows .NET applications to access GeographicLib::GravityCircle. 00019 * 00020 * Evaluate the earth's gravity 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 GravityModel::Circle to create a GravityCircle object. (The 00026 * constructor for this class is for internal use only.) 00027 * 00028 * C# Example: 00029 * \include example-GravityCircle.cs 00030 * Managed C++ Example: 00031 * \include example-GravityCircle.cpp 00032 * Visual Basic Example: 00033 * \include example-GravityCircle.vb 00034 * 00035 * <B>INTERFACE DIFFERENCES:</B><BR> 00036 * The following functions are implemented as properties: 00037 * Init, MajorRadius, Flattening, Latitude, and Height. 00038 * 00039 * The Capabilities functions accept and return the "capabilities mask" 00040 * as a NETGeographicLib::GravityModel::Mask rather than an unsigned. 00041 **********************************************************************/ 00042 public ref class GravityCircle 00043 { 00044 private: 00045 // the pointer to the unmanaged GeographicLib::GravityCircle. 00046 const GeographicLib::GravityCircle* m_pGravityCircle; 00047 00048 // the finalizer frees the unmanaged memory when the object is destroyed. 00049 !GravityCircle(void); 00050 public: 00051 /** 00052 * A constructor that is initialized from an unmanaged 00053 * GeographicLib::GravityCircle. For internal use only. Developers 00054 * should use GravityModel::Circle to create a GavityCircle object. 00055 **********************************************************************/ 00056 GravityCircle( const GeographicLib::GravityCircle& gc ); 00057 00058 /** 00059 * The destructor calls the finalizer. 00060 **********************************************************************/ 00061 ~GravityCircle() 00062 { this->!GravityCircle(); } 00063 00064 /** \name Compute the gravitational field 00065 **********************************************************************/ 00066 ///@{ 00067 /** 00068 * Evaluate the gravity. 00069 * 00070 * @param[in] lon the geographic longitude (degrees). 00071 * @param[out] gx the easterly component of the acceleration 00072 * (m s<sup>−2</sup>). 00073 * @param[out] gy the northerly component of the acceleration 00074 * (m s<sup>−2</sup>). 00075 * @param[out] gz the upward component of the acceleration 00076 * (m s<sup>−2</sup>); this is usually negative. 00077 * @return \e W the sum of the gravitational and centrifugal potentials. 00078 * 00079 * The function includes the effects of the earth's rotation. 00080 **********************************************************************/ 00081 double Gravity(double lon, 00082 [System::Runtime::InteropServices::Out] double% gx, 00083 [System::Runtime::InteropServices::Out] double% gy, 00084 [System::Runtime::InteropServices::Out] double% gz); 00085 00086 /** 00087 * Evaluate the gravity disturbance vector. 00088 * 00089 * @param[in] lon the geographic longitude (degrees). 00090 * @param[out] deltax the easterly component of the disturbance vector 00091 * (m s<sup>−2</sup>). 00092 * @param[out] deltay the northerly component of the disturbance vector 00093 * (m s<sup>−2</sup>). 00094 * @param[out] deltaz the upward component of the disturbance vector 00095 * (m s<sup>−2</sup>). 00096 * @return \e T the corresponding disturbing potential. 00097 **********************************************************************/ 00098 double Disturbance(double lon, 00099 [System::Runtime::InteropServices::Out] double% deltax, 00100 [System::Runtime::InteropServices::Out] double% deltay, 00101 [System::Runtime::InteropServices::Out] double% deltaz); 00102 00103 /** 00104 * Evaluate the geoid height. 00105 * 00106 * @param[in] lon the geographic longitude (degrees). 00107 * @return \e N the height of the geoid above the reference ellipsoid 00108 * (meters). 00109 * 00110 * Some approximations are made in computing the geoid height so that the 00111 * results of the NGA codes are reproduced accurately. Details are given 00112 * in \ref gravitygeoid. 00113 **********************************************************************/ 00114 double GeoidHeight(double lon); 00115 00116 /** 00117 * Evaluate the components of the gravity anomaly vector using the 00118 * spherical approximation. 00119 * 00120 * @param[in] lon the geographic longitude (degrees). 00121 * @param[out] Dg01 the gravity anomaly (m s<sup>−2</sup>). 00122 * @param[out] xi the northerly component of the deflection of the vertical 00123 * (degrees). 00124 * @param[out] eta the easterly component of the deflection of the vertical 00125 * (degrees). 00126 * 00127 * The spherical approximation (see Heiskanen and Moritz, Sec 2-14) is used 00128 * so that the results of the NGA codes are reproduced accurately. 00129 * approximations used here. Details are given in \ref gravitygeoid. 00130 **********************************************************************/ 00131 void SphericalAnomaly(double lon, 00132 [System::Runtime::InteropServices::Out] double% Dg01, 00133 [System::Runtime::InteropServices::Out] double% xi, 00134 [System::Runtime::InteropServices::Out] double% eta); 00135 00136 /** 00137 * Evaluate the components of the acceleration due to gravity and the 00138 * centrifugal acceleration in geocentric coordinates. 00139 * 00140 * @param[in] lon the geographic longitude (degrees). 00141 * @param[out] gX the \e X component of the acceleration 00142 * (m s<sup>−2</sup>). 00143 * @param[out] gY the \e Y component of the acceleration 00144 * (m s<sup>−2</sup>). 00145 * @param[out] gZ the \e Z component of the acceleration 00146 * (m s<sup>−2</sup>). 00147 * @return \e W = \e V + Φ the sum of the gravitational and 00148 * centrifugal potentials (m<sup>2</sup> s<sup>−2</sup>). 00149 **********************************************************************/ 00150 double W(double lon, 00151 [System::Runtime::InteropServices::Out] double% gX, 00152 [System::Runtime::InteropServices::Out] double% gY, 00153 [System::Runtime::InteropServices::Out] double% gZ); 00154 00155 /** 00156 * Evaluate the components of the acceleration due to gravity in geocentric 00157 * coordinates. 00158 * 00159 * @param[in] lon the geographic longitude (degrees). 00160 * @param[out] GX the \e X component of the acceleration 00161 * (m s<sup>−2</sup>). 00162 * @param[out] GY the \e Y component of the acceleration 00163 * (m s<sup>−2</sup>). 00164 * @param[out] GZ the \e Z component of the acceleration 00165 * (m s<sup>−2</sup>). 00166 * @return \e V = \e W - Φ the gravitational potential 00167 * (m<sup>2</sup> s<sup>−2</sup>). 00168 **********************************************************************/ 00169 double V(double lon, 00170 [System::Runtime::InteropServices::Out] double% GX, 00171 [System::Runtime::InteropServices::Out] double% GY, 00172 [System::Runtime::InteropServices::Out] double% GZ); 00173 00174 /** 00175 * Evaluate the components of the gravity disturbance in geocentric 00176 * coordinates. 00177 * 00178 * @param[in] lon the geographic longitude (degrees). 00179 * @param[out] deltaX the \e X component of the gravity disturbance 00180 * (m s<sup>−2</sup>). 00181 * @param[out] deltaY the \e Y component of the gravity disturbance 00182 * (m s<sup>−2</sup>). 00183 * @param[out] deltaZ the \e Z component of the gravity disturbance 00184 * (m s<sup>−2</sup>). 00185 * @return \e T = \e W - \e U the disturbing potential (also called the 00186 * anomalous potential) (m<sup>2</sup> s<sup>−2</sup>). 00187 **********************************************************************/ 00188 double T(double lon, 00189 [System::Runtime::InteropServices::Out] double% deltaX, 00190 [System::Runtime::InteropServices::Out] double% deltaY, 00191 [System::Runtime::InteropServices::Out] double% deltaZ); 00192 00193 /** 00194 * Evaluate disturbing potential in geocentric coordinates. 00195 * 00196 * @param[in] lon the geographic longitude (degrees). 00197 * @return \e T = \e W - \e U the disturbing potential (also called the 00198 * anomalous potential) (m<sup>2</sup> s<sup>−2</sup>). 00199 **********************************************************************/ 00200 double T(double lon); 00201 00202 ///@} 00203 00204 /** \name Inspector functions 00205 **********************************************************************/ 00206 ///@{ 00207 /** 00208 * @return true if the object has been initialized. 00209 **********************************************************************/ 00210 property bool Init { bool get(); } 00211 00212 /** 00213 * @return \e a the equatorial radius of the ellipsoid (meters). This is 00214 * the value inherited from the GravityModel object used in the 00215 * constructor. 00216 * This property throws an exception if the GravityCircles has not 00217 * been initialized. 00218 **********************************************************************/ 00219 property double MajorRadius { double get(); } 00220 00221 /** 00222 * @return \e f the flattening of the ellipsoid. This is the value 00223 * inherited from the GravityModel object used in the constructor. 00224 * This property throws an exception if the GravityCircles has not 00225 * been initialized. 00226 **********************************************************************/ 00227 property double Flattening { double get(); } 00228 00229 /** 00230 * @return the latitude of the circle (degrees). 00231 * This property throws an exception if the GravityCircles has not 00232 * been initialized. 00233 **********************************************************************/ 00234 property double Latitude { double get(); } 00235 00236 /** 00237 * @return the height of the circle (meters). 00238 * This property throws an exception if the GravityCircles has not 00239 * been initialized. 00240 **********************************************************************/ 00241 property double Height { double get(); } 00242 00243 /** 00244 * @return \e caps the computational capabilities that this object was 00245 * constructed with. 00246 **********************************************************************/ 00247 GravityModel::Mask Capabilities(); 00248 00249 /** 00250 * @param[in] testcaps a set of bitor'ed GeodesicLine::mask values. 00251 * @return true if the GeodesicLine object has all these capabilities. 00252 **********************************************************************/ 00253 bool Capabilities(GravityModel::Mask testcaps); 00254 ///@} 00255 }; 00256 } // namespace NETGeographicLib