NETGeographicLib  1.40
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Pages
AzimuthalEquidistant.h
Go to the documentation of this file.
1 /**
2  * \file NETGeographicLib/AzimuthalEquidistant.h
3  * \brief Header for NETGeographicLib::AzimuthalEquidistant class
4  *
5  * NETGeographicLib is copyright (c) Scott Heiman (2013)
6  * GeographicLib is Copyright (c) Charles Karney (2010-2012)
7  * <charles@karney.com> and licensed under the MIT/X11 License.
8  * For more information, see
9  * http://geographiclib.sourceforge.net/
10  **********************************************************************/
11 #pragma once
12 #include "Geodesic.h"
13 
14 namespace NETGeographicLib
15 {
16  /**
17  * \brief .NET wrapper for GeographicLib::AzimuthalEquidistant.
18  *
19  * This class allows .NET applications to access GeographicLib::AzimuthalEquidistant.
20  *
21  * Azimuthal equidistant projection centered at an arbitrary position on the
22  * ellipsoid. For a point in projected space (\e x, \e y), the geodesic
23  * distance from the center position is hypot(\e x, \e y) and the azimuth of
24  * the geodesic from the center point is atan2(\e x, \e y). The Forward and
25  * Reverse methods also return the azimuth \e azi of the geodesic at (\e x,
26  * \e y) and reciprocal scale \e rk in the azimuthal direction which,
27  * together with the basic properties of the projection, serve to specify
28  * completely the local affine transformation between geographic and
29  * projected coordinates.
30  *
31  * The conversions all take place using a Geodesic object (by default
32  * Geodesic::WGS84). For more information on geodesics see \ref geodesic.
33  *
34  * C# Example:
35  * \include example-AzimuthalEquidistant.cs
36  * Managed C++ Example:
37  * \include example-AzimuthalEquidistant.cpp
38  * Visual Basic Example:
39  * \include example-AzimuthalEquidistant.vb
40  *
41  * <B>INTERFACE DIFFERENCES:</B><BR>
42  * A default constructor is provided that assumes a WGS84 ellipsoid.
43  *
44  * The MajorRadius and Flattening functions are implemented as
45  * properties.
46  **********************************************************************/
47  public ref class AzimuthalEquidistant
48  {
49  private:
50  // Pointer to the unmanaged GeographicLib::AzimuthalEquidistant
51  const GeographicLib::AzimuthalEquidistant* m_pAzimuthalEquidistant;
52 
53  // Frees the unmanaged memory when the object is destroyed.
55  public:
56  /**
57  * Default Constructor for AzimuthalEquidistant.
58  * Assumes WGS84 Geodesic
59  **********************************************************************/
61 
62  /**
63  * Constructor for AzimuthalEquidistant.
64  *
65  * @param[in] earth the Geodesic object to use for geodesic calculations.
66  **********************************************************************/
68 
69  /**
70  * Destructor
71  *
72  * frees unmanaged memory.
73  **********************************************************************/
75  { this->!AzimuthalEquidistant(); }
76 
77  /**
78  * Forward projection, from geographic to azimuthal equidistant.
79  *
80  * @param[in] lat0 latitude of center point of projection (degrees).
81  * @param[in] lon0 longitude of center point of projection (degrees).
82  * @param[in] lat latitude of point (degrees).
83  * @param[in] lon longitude of point (degrees).
84  * @param[out] x easting of point (meters).
85  * @param[out] y northing of point (meters).
86  * @param[out] azi azimuth of geodesic at point (degrees).
87  * @param[out] rk reciprocal of azimuthal scale at point.
88  *
89  * \e lat0 and \e lat should be in the range [&minus;90&deg;,
90  * 90&deg;] and \e lon0 and \e lon should be in the range
91  * [&minus;540&deg;, 540&deg;). The scale of the projection is 1
92  * in the "radial" direction, \e azi clockwise from true north, and is 1/\e
93  * rk in the direction perpendicular to this. A call to Forward followed
94  * by a call to Reverse will return the original (\e lat, \e lon) (to
95  * within roundoff).
96  **********************************************************************/
97  void Forward(double lat0, double lon0, double lat, double lon,
98  [System::Runtime::InteropServices::Out] double% x,
99  [System::Runtime::InteropServices::Out] double% y,
100  [System::Runtime::InteropServices::Out] double% azi,
101  [System::Runtime::InteropServices::Out] double% rk);
102 
103  /**
104  * Reverse projection, from azimuthal equidistant to geographic.
105  *
106  * @param[in] lat0 latitude of center point of projection (degrees).
107  * @param[in] lon0 longitude of center point of projection (degrees).
108  * @param[in] x easting of point (meters).
109  * @param[in] y northing of point (meters).
110  * @param[out] lat latitude of point (degrees).
111  * @param[out] lon longitude of point (degrees).
112  * @param[out] azi azimuth of geodesic at point (degrees).
113  * @param[out] rk reciprocal of azimuthal scale at point.
114  *
115  * \e lat0 should be in the range [&minus;90&deg;, 90&deg;] and \e
116  * lon0 should be in the range [&minus;540&deg;, 540&deg;). \e lat
117  * will be in the range [&minus;90&deg;, 90&deg;] and \e lon will
118  * be in the range [&minus;180&deg;, 180&deg;). The scale of the
119  * projection is 1 in the "radial" direction, \e azi clockwise from true
120  * north, and is 1/\e rk in the direction perpendicular to this. A call to
121  * Reverse followed by a call to Forward will return the original (\e x, \e
122  * y) (to roundoff) only if the geodesic to (\e x, \e y) is a shortest
123  * path.
124  **********************************************************************/
125  void Reverse(double lat0, double lon0, double x, double y,
126  [System::Runtime::InteropServices::Out] double% lat,
127  [System::Runtime::InteropServices::Out] double% lon,
128  [System::Runtime::InteropServices::Out] double% azi,
129  [System::Runtime::InteropServices::Out] double% rk);
130 
131  /**
132  * AzimuthalEquidistant::Forward without returning the azimuth and scale.
133  **********************************************************************/
134  void Forward(double lat0, double lon0, double lat, double lon,
135  [System::Runtime::InteropServices::Out] double% x,
136  [System::Runtime::InteropServices::Out] double% y);
137 
138  /**
139  * AzimuthalEquidistant::Reverse without returning the azimuth and scale.
140  **********************************************************************/
141  void Reverse(double lat0, double lon0, double x, double y,
142  [System::Runtime::InteropServices::Out] double% lat,
143  [System::Runtime::InteropServices::Out] double% lon);
144 
145  /** \name Inspector functions
146  **********************************************************************/
147  ///@{
148  /**
149  * @return \e a the equatorial radius of the ellipsoid (meters). This is
150  * the value inherited from the Geodesic object used in the constructor.
151  **********************************************************************/
152  property double MajorRadius { double get(); }
153 
154  /**
155  * @return \e f the flattening of the ellipsoid. This is the value
156  * inherited from the Geodesic object used in the constructor.
157  **********************************************************************/
158  property double Flattening { double get(); }
159  ///@}
160  };
161 } // namespace NETGeographicLib
void Forward(double lat0, double lon0, double lat, double lon, [System::Runtime::InteropServices::Out] double% x, [System::Runtime::InteropServices::Out] double% y, [System::Runtime::InteropServices::Out] double% azi, [System::Runtime::InteropServices::Out] double% rk)
void Reverse(double lat0, double lon0, double x, double y, [System::Runtime::InteropServices::Out] double% lat, [System::Runtime::InteropServices::Out] double% lon, [System::Runtime::InteropServices::Out] double% azi, [System::Runtime::InteropServices::Out] double% rk)
.NET wrapper for GeographicLib::Geodesic.
Definition: Geodesic.h:170
.NET wrapper for GeographicLib::AzimuthalEquidistant.
Header for NETGeographicLib::Geodesic class.