00001 /** 00002 * \file NETGeographicLib/AzimuthalEquidistant.h 00003 * \brief Header for NETGeographicLib::AzimuthalEquidistant class 00004 * 00005 * NETGeographicLib is copyright (c) Scott Heiman (2013) 00006 * GeographicLib is Copyright (c) Charles Karney (2010-2012) 00007 * <charles@karney.com> and licensed under the MIT/X11 License. 00008 * For more information, see 00009 * http://geographiclib.sourceforge.net/ 00010 **********************************************************************/ 00011 #pragma once 00012 #include "Geodesic.h" 00013 00014 namespace NETGeographicLib 00015 { 00016 /** 00017 * \brief .NET wrapper for GeographicLib::AzimuthalEquidistant. 00018 * 00019 * This class allows .NET applications to access GeographicLib::AzimuthalEquidistant. 00020 * 00021 * Azimuthal equidistant projection centered at an arbitrary position on the 00022 * ellipsoid. For a point in projected space (\e x, \e y), the geodesic 00023 * distance from the center position is hypot(\e x, \e y) and the azimuth of 00024 * the geodesic from the center point is atan2(\e x, \e y). The Forward and 00025 * Reverse methods also return the azimuth \e azi of the geodesic at (\e x, 00026 * \e y) and reciprocal scale \e rk in the azimuthal direction which, 00027 * together with the basic properties of the projection, serve to specify 00028 * completely the local affine transformation between geographic and 00029 * projected coordinates. 00030 * 00031 * The conversions all take place using a Geodesic object (by default 00032 * Geodesic::WGS84). For more information on geodesics see \ref geodesic. 00033 * 00034 * C# Example: 00035 * \include example-AzimuthalEquidistant.cs 00036 * Managed C++ Example: 00037 * \include example-AzimuthalEquidistant.cpp 00038 * Visual Basic Example: 00039 * \include example-AzimuthalEquidistant.vb 00040 * 00041 * <B>INTERFACE DIFFERENCES:</B><BR> 00042 * A default constructor is provided that assumes a WGS84 ellipsoid. 00043 * 00044 * The MajorRadius and Flattening functions are implemented as 00045 * properties. 00046 **********************************************************************/ 00047 public ref class AzimuthalEquidistant 00048 { 00049 private: 00050 // Pointer to the unmanaged GeographicLib::AzimuthalEquidistant 00051 const GeographicLib::AzimuthalEquidistant* m_pAzimuthalEquidistant; 00052 00053 // Frees the unmanaged memory when the object is destroyed. 00054 !AzimuthalEquidistant(); 00055 public: 00056 /** 00057 * Default Constructor for AzimuthalEquidistant. 00058 * Assumes WGS84 Geodesic 00059 **********************************************************************/ 00060 AzimuthalEquidistant(void); 00061 00062 /** 00063 * Constructor for AzimuthalEquidistant. 00064 * 00065 * @param[in] earth the Geodesic object to use for geodesic calculations. 00066 **********************************************************************/ 00067 AzimuthalEquidistant( Geodesic^ earth ); 00068 00069 /** 00070 * Destructor 00071 * 00072 * frees unmanaged memory. 00073 **********************************************************************/ 00074 ~AzimuthalEquidistant() 00075 { this->!AzimuthalEquidistant(); } 00076 00077 /** 00078 * Forward projection, from geographic to azimuthal equidistant. 00079 * 00080 * @param[in] lat0 latitude of center point of projection (degrees). 00081 * @param[in] lon0 longitude of center point of projection (degrees). 00082 * @param[in] lat latitude of point (degrees). 00083 * @param[in] lon longitude of point (degrees). 00084 * @param[out] x easting of point (meters). 00085 * @param[out] y northing of point (meters). 00086 * @param[out] azi azimuth of geodesic at point (degrees). 00087 * @param[out] rk reciprocal of azimuthal scale at point. 00088 * 00089 * \e lat0 and \e lat should be in the range [−90°, 00090 * 90°] and \e lon0 and \e lon should be in the range 00091 * [−540°, 540°). The scale of the projection is 1 00092 * in the "radial" direction, \e azi clockwise from true north, and is 1/\e 00093 * rk in the direction perpendicular to this. A call to Forward followed 00094 * by a call to Reverse will return the original (\e lat, \e lon) (to 00095 * within roundoff). 00096 **********************************************************************/ 00097 void Forward(double lat0, double lon0, double lat, double lon, 00098 [System::Runtime::InteropServices::Out] double% x, 00099 [System::Runtime::InteropServices::Out] double% y, 00100 [System::Runtime::InteropServices::Out] double% azi, 00101 [System::Runtime::InteropServices::Out] double% rk); 00102 00103 /** 00104 * Reverse projection, from azimuthal equidistant to geographic. 00105 * 00106 * @param[in] lat0 latitude of center point of projection (degrees). 00107 * @param[in] lon0 longitude of center point of projection (degrees). 00108 * @param[in] x easting of point (meters). 00109 * @param[in] y northing of point (meters). 00110 * @param[out] lat latitude of point (degrees). 00111 * @param[out] lon longitude of point (degrees). 00112 * @param[out] azi azimuth of geodesic at point (degrees). 00113 * @param[out] rk reciprocal of azimuthal scale at point. 00114 * 00115 * \e lat0 should be in the range [−90°, 90°] and \e 00116 * lon0 should be in the range [−540°, 540°). \e lat 00117 * will be in the range [−90°, 90°] and \e lon will 00118 * be in the range [−180°, 180°). The scale of the 00119 * projection is 1 in the "radial" direction, \e azi clockwise from true 00120 * north, and is 1/\e rk in the direction perpendicular to this. A call to 00121 * Reverse followed by a call to Forward will return the original (\e x, \e 00122 * y) (to roundoff) only if the geodesic to (\e x, \e y) is a shortest 00123 * path. 00124 **********************************************************************/ 00125 void Reverse(double lat0, double lon0, double x, double y, 00126 [System::Runtime::InteropServices::Out] double% lat, 00127 [System::Runtime::InteropServices::Out] double% lon, 00128 [System::Runtime::InteropServices::Out] double% azi, 00129 [System::Runtime::InteropServices::Out] double% rk); 00130 00131 /** 00132 * AzimuthalEquidistant::Forward without returning the azimuth and scale. 00133 **********************************************************************/ 00134 void Forward(double lat0, double lon0, double lat, double lon, 00135 [System::Runtime::InteropServices::Out] double% x, 00136 [System::Runtime::InteropServices::Out] double% y); 00137 00138 /** 00139 * AzimuthalEquidistant::Reverse without returning the azimuth and scale. 00140 **********************************************************************/ 00141 void Reverse(double lat0, double lon0, double x, double y, 00142 [System::Runtime::InteropServices::Out] double% lat, 00143 [System::Runtime::InteropServices::Out] double% lon); 00144 00145 /** \name Inspector functions 00146 **********************************************************************/ 00147 ///@{ 00148 /** 00149 * @return \e a the equatorial radius of the ellipsoid (meters). This is 00150 * the value inherited from the Geodesic object used in the constructor. 00151 **********************************************************************/ 00152 property double MajorRadius { double get(); } 00153 00154 /** 00155 * @return \e f the flattening of the ellipsoid. This is the value 00156 * inherited from the Geodesic object used in the constructor. 00157 **********************************************************************/ 00158 property double Flattening { double get(); } 00159 ///@} 00160 }; 00161 } // namespace NETGeographicLib