NETGeographicLib  1.40
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Pages
GeodesicExact.h
Go to the documentation of this file.
1 #pragma once
2 /**
3  * \file NETGeographicLib/GeodesicExact.h
4  * \brief Header for NETGeographicLib::GeodesicExact class
5  *
6  * NETGeographicLib is copyright (c) Scott Heiman (2013)
7  * GeographicLib is Copyright (c) Charles Karney (2010-2012)
8  * <charles@karney.com> and licensed under the MIT/X11 License.
9  * For more information, see
10  * http://geographiclib.sourceforge.net/
11  **********************************************************************/
12 #include "NETGeographicLib.h"
13 
14 namespace NETGeographicLib
15 {
16  ref class GeodesicLineExact;
17  /*!
18  \brief .NET wrapper for GeographicLib::GeodesicExact.
19 
20  This class allows .NET applications to access GeographicLib::GeodesicExact.
21  */
22  /**
23  * \brief .NET wrapper for GeographicLib::GeodesicExact.
24  *
25  * This class allows .NET applications to access GeographicLib::GeodesicExact.
26  *
27  * The equations for geodesics on an ellipsoid can be expressed in terms of
28  * incomplete elliptic integrals. The Geodesic class expands these integrals
29  * in a series in the flattening \e f and this provides an accurate solution
30  * for \e f &isin [-0.01, 0.01]. The GeodesicExact class computes the
31  * ellitpic integrals directly and so provides a solution which is valid for
32  * all \e f. However, in practice, its use should be limited to about \e
33  * b/\e a &isin; [0.01, 100] or \e f &isin; [-99, 0.99].
34  *
35  * For the WGS84 ellipsoid, these classes are 2--3 times \e slower than the
36  * series solution and 2--3 times \e less \e accurate (because it's less easy
37  * to control round-off errors with the elliptic integral formulation); i.e.,
38  * the error is about 40 nm (40 nanometers) instead of 15 nm. However the
39  * error in the series solution scales as <i>f</i><sup>7</sup> while the
40  * error in the elliptic integral solution depends weakly on \e f. If the
41  * quarter meridian distance is 10000 km and the ratio \e b/\e a = 1 &minus;
42  * \e f is varied then the approximate maximum error (expressed as a
43  * distance) is <pre>
44  * 1 - f error (nm)
45  * 1/128 387
46  * 1/64 345
47  * 1/32 269
48  * 1/16 210
49  * 1/8 115
50  * 1/4 69
51  * 1/2 36
52  * 1 15
53  * 2 25
54  * 4 96
55  * 8 318
56  * 16 985
57  * 32 2352
58  * 64 6008
59  * 128 19024
60  * </pre>
61  *
62  * The computation of the area in these classes is via a 30th order series.
63  * This gives accurate results for \e b/\e a &isin; [1/2, 2]; the accuracy is
64  * about 8 decimal digits for \e b/\e a &isin; [1/4, 4].
65  *
66  * See \ref geodellip for the formulation. See the documentation on the
67  * Geodesic class for additional information on the geodesics problems.
68  *
69  * C# Example:
70  * \include example-GeodesicExact.cs
71  * Managed C++ Example:
72  * \include example-GeodesicExact.cpp
73  * Visual Basic Example:
74  * \include example-GeodesicExact.vb
75  *
76  * <B>INTERFACE DIFFERENCES:</B><BR>
77  * A default constructor is provided that assumes WGS84 parameters.
78  *
79  * The MajorRadius, Flattening, and EllipsoidArea functions are
80  * implemented as properties.
81  *
82  * The GenDirect, GenInverse, and Line functions accept the
83  * "capabilities mask" as a NETGeographicLib::Mask rather than an
84  * unsigned.
85  **********************************************************************/
86  public ref class GeodesicExact
87  {
88  private:
89  enum class captype {
90  CAP_NONE = 0U,
91  CAP_E = 1U<<0,
92  // Skip 1U<<1 for compatibility with Geodesic (not required)
93  CAP_D = 1U<<2,
94  CAP_H = 1U<<3,
95  CAP_C4 = 1U<<4,
96  CAP_ALL = 0x1FU,
97  CAP_MASK = CAP_ALL,
98  OUT_ALL = 0x7F80U,
99  OUT_MASK = 0xFF80U, // Includes LONG_NOWRAP
100  };
101  // pointer to the unmanaged GeographicLib::GeodesicExact.
102  const GeographicLib::GeodesicExact* m_pGeodesicExact;
103 
104  // the finalizer deletes the unmanaged memory.
105  !GeodesicExact();
106  public:
107  /**
108  * Bit masks for what calculations to do. These masks do double duty.
109  * They signify to the GeodesicLineExact::GeodesicLineExact constructor and
110  * to GeodesicExact::Line what capabilities should be included in the
111  * GeodesicLineExact object. They also specify which results to return in
112  * the general routines GeodesicExact::GenDirect and
113  * GeodesicExact::GenInverse routines. GeodesicLineExact::mask is a
114  * duplication of this enum.
115  **********************************************************************/
116  enum class mask {
117  /**
118  * No capabilities, no output.
119  * @hideinitializer
120  **********************************************************************/
121  NONE = 0U,
122  /**
123  * Calculate latitude \e lat2. (It's not necessary to include this as a
124  * capability to GeodesicLineExact because this is included by default.)
125  * @hideinitializer
126  **********************************************************************/
127  LATITUDE = 1U<<7 | unsigned(captype::CAP_NONE),
128  /**
129  * Calculate longitude \e lon2.
130  * @hideinitializer
131  **********************************************************************/
132  LONGITUDE = 1U<<8 | unsigned(captype::CAP_H),
133  /**
134  * Calculate azimuths \e azi1 and \e azi2. (It's not necessary to
135  * include this as a capability to GeodesicLineExact because this is
136  * included by default.)
137  * @hideinitializer
138  **********************************************************************/
139  AZIMUTH = 1U<<9 | unsigned(captype::CAP_NONE),
140  /**
141  * Calculate distance \e s12.
142  * @hideinitializer
143  **********************************************************************/
144  DISTANCE = 1U<<10 | unsigned(captype::CAP_E),
145  /**
146  * Allow distance \e s12 to be used as input in the direct geodesic
147  * problem.
148  * @hideinitializer
149  **********************************************************************/
150  DISTANCE_IN = 1U<<11 | unsigned(captype::CAP_E),
151  /**
152  * Calculate reduced length \e m12.
153  * @hideinitializer
154  **********************************************************************/
155  REDUCEDLENGTH = 1U<<12 | unsigned(captype::CAP_D),
156  /**
157  * Calculate geodesic scales \e M12 and \e M21.
158  * @hideinitializer
159  **********************************************************************/
160  GEODESICSCALE = 1U<<13 | unsigned(captype::CAP_D),
161  /**
162  * Calculate area \e S12.
163  * @hideinitializer
164  **********************************************************************/
165  AREA = 1U<<14 | unsigned(captype::CAP_C4),
166  /**
167  * Do not wrap the \e lon2 in the direct calculation.
168  * @hideinitializer
169  **********************************************************************/
170  LONG_NOWRAP = 1U<<15,
171  /**
172  * All capabilities, calculate everything. (LONG_NOWRAP is not
173  * included in this mask.)
174  * @hideinitializer
175  **********************************************************************/
176  ALL = unsigned(captype::OUT_ALL)| unsigned(captype::CAP_ALL),
177  };
178 
179  /** \name Constructor
180  **********************************************************************/
181  ///@{
182  /**
183  * Constructor for a WGS84 ellipsoid
184  **********************************************************************/
185  GeodesicExact();
186 
187  /**
188  * Constructor for a ellipsoid with
189  *
190  * @param[in] a equatorial radius (meters).
191  * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere.
192  * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening
193  * to 1/\e f.
194  * @exception GeographicErr if \e a or (1 &minus; \e f ) \e a is not
195  * positive.
196  **********************************************************************/
197  GeodesicExact(double a, double f);
198  ///@}
199 
200  /**
201  * The desstructor calls the finalizer.
202  **********************************************************************/
204  { this->!GeodesicExact(); }
205 
206  /** \name Direct geodesic problem specified in terms of distance.
207  **********************************************************************/
208  ///@{
209  /**
210  * Perform the direct geodesic calculation where the length of the geodesic
211  * is specified in terms of distance.
212  *
213  * @param[in] lat1 latitude of point 1 (degrees).
214  * @param[in] lon1 longitude of point 1 (degrees).
215  * @param[in] azi1 azimuth at point 1 (degrees).
216  * @param[in] s12 distance between point 1 and point 2 (meters); it can be
217  * signed.
218  * @param[out] lat2 latitude of point 2 (degrees).
219  * @param[out] lon2 longitude of point 2 (degrees).
220  * @param[out] azi2 (forward) azimuth at point 2 (degrees).
221  * @param[out] m12 reduced length of geodesic (meters).
222  * @param[out] M12 geodesic scale of point 2 relative to point 1
223  * (dimensionless).
224  * @param[out] M21 geodesic scale of point 1 relative to point 2
225  * (dimensionless).
226  * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
227  * @return \e a12 arc length of between point 1 and point 2 (degrees).
228  *
229  * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 and \e
230  * azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of
231  * \e lon2 and \e azi2 returned are in the range [&minus;180&deg;,
232  * 180&deg;).
233  *
234  * If either point is at a pole, the azimuth is defined by keeping the
235  * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;),
236  * and taking the limit &epsilon; &rarr; 0+. An arc length greater that
237  * 180&deg; signifies a geodesic which is not a shortest path. (For a
238  * prolate ellipsoid, an additional condition is necessary for a shortest
239  * path: the longitudinal extent must not exceed of 180&deg;.)
240  *
241  * The following functions are overloaded versions of GeodesicExact::Direct
242  * which omit some of the output parameters. Note, however, that the arc
243  * length is always computed and returned as the function value.
244  **********************************************************************/
245  double Direct(double lat1, double lon1, double azi1, double s12,
246  [System::Runtime::InteropServices::Out] double% lat2,
247  [System::Runtime::InteropServices::Out] double% lon2,
248  [System::Runtime::InteropServices::Out] double% azi2,
249  [System::Runtime::InteropServices::Out] double% m12,
250  [System::Runtime::InteropServices::Out] double% M12,
251  [System::Runtime::InteropServices::Out] double% M21,
252  [System::Runtime::InteropServices::Out] double% S12);
253 
254  /**
255  * See the documentation for GeodesicExact::Direct.
256  **********************************************************************/
257  double Direct(double lat1, double lon1, double azi1, double s12,
258  [System::Runtime::InteropServices::Out] double% lat2,
259  [System::Runtime::InteropServices::Out] double% lon2);
260 
261  /**
262  * See the documentation for GeodesicExact::Direct.
263  **********************************************************************/
264  double Direct(double lat1, double lon1, double azi1, double s12,
265  [System::Runtime::InteropServices::Out] double% lat2,
266  [System::Runtime::InteropServices::Out] double% lon2,
267  [System::Runtime::InteropServices::Out] double% azi2);
268 
269  /**
270  * See the documentation for GeodesicExact::Direct.
271  **********************************************************************/
272  double Direct(double lat1, double lon1, double azi1, double s12,
273  [System::Runtime::InteropServices::Out] double% lat2,
274  [System::Runtime::InteropServices::Out] double% lon2,
275  [System::Runtime::InteropServices::Out] double% azi2,
276  [System::Runtime::InteropServices::Out] double% m12);
277 
278  /**
279  * See the documentation for GeodesicExact::Direct.
280  **********************************************************************/
281  double Direct(double lat1, double lon1, double azi1, double s12,
282  [System::Runtime::InteropServices::Out] double% lat2,
283  [System::Runtime::InteropServices::Out] double% lon2,
284  [System::Runtime::InteropServices::Out] double% azi2,
285  [System::Runtime::InteropServices::Out] double% M12,
286  [System::Runtime::InteropServices::Out] double% M21);
287 
288  /**
289  * See the documentation for GeodesicExact::Direct.
290  **********************************************************************/
291  double Direct(double lat1, double lon1, double azi1, double s12,
292  [System::Runtime::InteropServices::Out] double% lat2,
293  [System::Runtime::InteropServices::Out] double% lon2,
294  [System::Runtime::InteropServices::Out] double% azi2,
295  [System::Runtime::InteropServices::Out] double% m12,
296  [System::Runtime::InteropServices::Out] double% M12,
297  [System::Runtime::InteropServices::Out] double% M21);
298  ///@}
299 
300  /** \name Direct geodesic problem specified in terms of arc length.
301  **********************************************************************/
302  ///@{
303  /**
304  * Perform the direct geodesic calculation where the length of the geodesic
305  * is specified in terms of arc length.
306  *
307  * @param[in] lat1 latitude of point 1 (degrees).
308  * @param[in] lon1 longitude of point 1 (degrees).
309  * @param[in] azi1 azimuth at point 1 (degrees).
310  * @param[in] a12 arc length between point 1 and point 2 (degrees); it can
311  * be signed.
312  * @param[out] lat2 latitude of point 2 (degrees).
313  * @param[out] lon2 longitude of point 2 (degrees).
314  * @param[out] azi2 (forward) azimuth at point 2 (degrees).
315  * @param[out] s12 distance between point 1 and point 2 (meters).
316  * @param[out] m12 reduced length of geodesic (meters).
317  * @param[out] M12 geodesic scale of point 2 relative to point 1
318  * (dimensionless).
319  * @param[out] M21 geodesic scale of point 1 relative to point 2
320  * (dimensionless).
321  * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
322  *
323  * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 and \e
324  * azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of
325  * \e lon2 and \e azi2 returned are in the range [&minus;180&deg;,
326  * 180&deg;).
327  *
328  * If either point is at a pole, the azimuth is defined by keeping the
329  * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;),
330  * and taking the limit &epsilon; &rarr; 0+. An arc length greater that
331  * 180&deg; signifies a geodesic which is not a shortest path. (For a
332  * prolate ellipsoid, an additional condition is necessary for a shortest
333  * path: the longitudinal extent must not exceed of 180&deg;.)
334  *
335  * The following functions are overloaded versions of GeodesicExact::Direct
336  * which omit some of the output parameters.
337  **********************************************************************/
338  void ArcDirect(double lat1, double lon1, double azi1, double a12,
339  [System::Runtime::InteropServices::Out] double% lat2,
340  [System::Runtime::InteropServices::Out] double% lon2,
341  [System::Runtime::InteropServices::Out] double% azi2,
342  [System::Runtime::InteropServices::Out] double% s12,
343  [System::Runtime::InteropServices::Out] double% m12,
344  [System::Runtime::InteropServices::Out] double% M12,
345  [System::Runtime::InteropServices::Out] double% M21,
346  [System::Runtime::InteropServices::Out] double% S12);
347 
348  /**
349  * See the documentation for GeodesicExact::ArcDirect.
350  **********************************************************************/
351  void ArcDirect(double lat1, double lon1, double azi1, double a12,
352  [System::Runtime::InteropServices::Out] double% lat2,
353  [System::Runtime::InteropServices::Out] double% lon2);
354 
355  /**
356  * See the documentation for GeodesicExact::ArcDirect.
357  **********************************************************************/
358  void ArcDirect(double lat1, double lon1, double azi1, double a12,
359  [System::Runtime::InteropServices::Out] double% lat2,
360  [System::Runtime::InteropServices::Out] double% lon2,
361  [System::Runtime::InteropServices::Out] double% azi2);
362 
363  /**
364  * See the documentation for GeodesicExact::ArcDirect.
365  **********************************************************************/
366  void ArcDirect(double lat1, double lon1, double azi1, double a12,
367  [System::Runtime::InteropServices::Out] double% lat2,
368  [System::Runtime::InteropServices::Out] double% lon2,
369  [System::Runtime::InteropServices::Out] double% azi2,
370  [System::Runtime::InteropServices::Out] double% s12);
371 
372  /**
373  * See the documentation for GeodesicExact::ArcDirect.
374  **********************************************************************/
375  void ArcDirect(double lat1, double lon1, double azi1, double a12,
376  [System::Runtime::InteropServices::Out] double% lat2,
377  [System::Runtime::InteropServices::Out] double% lon2,
378  [System::Runtime::InteropServices::Out] double% azi2,
379  [System::Runtime::InteropServices::Out] double% s12,
380  [System::Runtime::InteropServices::Out] double% m12);
381 
382  /**
383  * See the documentation for GeodesicExact::ArcDirect.
384  **********************************************************************/
385  void ArcDirect(double lat1, double lon1, double azi1, double a12,
386  [System::Runtime::InteropServices::Out] double% lat2,
387  [System::Runtime::InteropServices::Out] double% lon2,
388  [System::Runtime::InteropServices::Out] double% azi2,
389  [System::Runtime::InteropServices::Out] double% s12,
390  [System::Runtime::InteropServices::Out] double% M12,
391  [System::Runtime::InteropServices::Out] double% M21);
392 
393  /**
394  * See the documentation for GeodesicExact::ArcDirect.
395  **********************************************************************/
396  void ArcDirect(double lat1, double lon1, double azi1, double a12,
397  [System::Runtime::InteropServices::Out] double% lat2,
398  [System::Runtime::InteropServices::Out] double% lon2,
399  [System::Runtime::InteropServices::Out] double% azi2,
400  [System::Runtime::InteropServices::Out] double% s12,
401  [System::Runtime::InteropServices::Out] double% m12,
402  [System::Runtime::InteropServices::Out] double% M12,
403  [System::Runtime::InteropServices::Out] double% M21);
404  ///@}
405 
406  /** \name General version of the direct geodesic solution.
407  **********************************************************************/
408  ///@{
409 
410  /**
411  * The general direct geodesic calculation. GeodesicExact::Direct and
412  * GeodesicExact::ArcDirect are defined in terms of this function.
413  *
414  * @param[in] lat1 latitude of point 1 (degrees).
415  * @param[in] lon1 longitude of point 1 (degrees).
416  * @param[in] azi1 azimuth at point 1 (degrees).
417  * @param[in] arcmode boolean flag determining the meaning of the second
418  * parameter.
419  * @param[in] s12_a12 if \e arcmode is false, this is the distance between
420  * point 1 and point 2 (meters); otherwise it is the arc length between
421  * point 1 and point 2 (degrees); it can be signed.
422  * @param[in] outmask a bitor'ed combination of GeodesicExact::mask values
423  * specifying which of the following parameters should be set.
424  * @param[out] lat2 latitude of point 2 (degrees).
425  * @param[out] lon2 longitude of point 2 (degrees).
426  * @param[out] azi2 (forward) azimuth at point 2 (degrees).
427  * @param[out] s12 distance between point 1 and point 2 (meters).
428  * @param[out] m12 reduced length of geodesic (meters).
429  * @param[out] M12 geodesic scale of point 2 relative to point 1
430  * (dimensionless).
431  * @param[out] M21 geodesic scale of point 1 relative to point 2
432  * (dimensionless).
433  * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
434  * @return \e a12 arc length of between point 1 and point 2 (degrees).
435  *
436  * The GeodesicExact::mask values possible for \e outmask are
437  * - \e outmask |= GeodesicExact::LATITUDE for the latitude \e lat2;
438  * - \e outmask |= GeodesicExact::LONGITUDE for the latitude \e lon2;
439  * - \e outmask |= GeodesicExact::AZIMUTH for the latitude \e azi2;
440  * - \e outmask |= GeodesicExact::DISTANCE for the distance \e s12;
441  * - \e outmask |= GeodesicExact::REDUCEDLENGTH for the reduced length \e
442  * m12;
443  * - \e outmask |= GeodesicExact::GEODESICSCALE for the geodesic scales \e
444  * M12 and \e M21;
445  * - \e outmask |= GeodesicExact::AREA for the area \e S12;
446  * - \e outmask |= GeodesicExact::ALL for all of the above;
447  * - \e outmask |= GeodesicExact::LONG_NOWRAP stops the returned value of
448  * \e lon2 being wrapped into the range [&minus;180&deg;, 180&deg;).
449  * .
450  * The function value \e a12 is always computed and returned and this
451  * equals \e s12_a12 is \e arcmode is true. If \e outmask includes
452  * GeodesicExact::DISTANCE and \e arcmode is false, then \e s12 = \e
453  * s12_a12. It is not necessary to include GeodesicExact::DISTANCE_IN in
454  * \e outmask; this is automatically included is \e arcmode is false.
455  *
456  * With the LONG_NOWRAP bit set, the quantity \e lon2 &minus; \e lon1
457  * indicates how many times the geodesic wrapped around the ellipsoid.
458  * Because \e lon2 might be outside the normal allowed range for
459  * longitudes, [&minus;540&deg;, 540&deg;), be sure to normalize it with
460  * Math::AngNormalize2 before using it in other GeographicLib calls.
461  **********************************************************************/
462  double GenDirect(double lat1, double lon1, double azi1,
463  bool arcmode, double s12_a12, GeodesicExact::mask outmask,
464  [System::Runtime::InteropServices::Out] double% lat2,
465  [System::Runtime::InteropServices::Out] double% lon2,
466  [System::Runtime::InteropServices::Out] double% azi2,
467  [System::Runtime::InteropServices::Out] double% s12,
468  [System::Runtime::InteropServices::Out] double% m12,
469  [System::Runtime::InteropServices::Out] double% M12,
470  [System::Runtime::InteropServices::Out] double% M21,
471  [System::Runtime::InteropServices::Out] double% S12);
472  ///@}
473 
474  /** \name Inverse geodesic problem.
475  **********************************************************************/
476  ///@{
477  /**
478  * Perform the inverse geodesic calculation.
479  *
480  * @param[in] lat1 latitude of point 1 (degrees).
481  * @param[in] lon1 longitude of point 1 (degrees).
482  * @param[in] lat2 latitude of point 2 (degrees).
483  * @param[in] lon2 longitude of point 2 (degrees).
484  * @param[out] s12 distance between point 1 and point 2 (meters).
485  * @param[out] azi1 azimuth at point 1 (degrees).
486  * @param[out] azi2 (forward) azimuth at point 2 (degrees).
487  * @param[out] m12 reduced length of geodesic (meters).
488  * @param[out] M12 geodesic scale of point 2 relative to point 1
489  * (dimensionless).
490  * @param[out] M21 geodesic scale of point 1 relative to point 2
491  * (dimensionless).
492  * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
493  * @return \e a12 arc length of between point 1 and point 2 (degrees).
494  *
495  * \e lat1 and \e lat2 should be in the range [&minus;90&deg;, 90&deg;]; \e
496  * lon1 and \e lon2 should be in the range [&minus;540&deg;, 540&deg;).
497  * The values of \e azi1 and \e azi2 returned are in the range
498  * [&minus;180&deg;, 180&deg;).
499  *
500  * If either point is at a pole, the azimuth is defined by keeping the
501  * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;),
502  * and taking the limit &epsilon; &rarr; 0+.
503  *
504  * The following functions are overloaded versions of GeodesicExact::Inverse
505  * which omit some of the output parameters. Note, however, that the arc
506  * length is always computed and returned as the function value.
507  **********************************************************************/
508  double Inverse(double lat1, double lon1, double lat2, double lon2,
509  [System::Runtime::InteropServices::Out] double% s12,
510  [System::Runtime::InteropServices::Out] double% azi1,
511  [System::Runtime::InteropServices::Out] double% azi2,
512  [System::Runtime::InteropServices::Out] double% m12,
513  [System::Runtime::InteropServices::Out] double% M12,
514  [System::Runtime::InteropServices::Out] double% M21,
515  [System::Runtime::InteropServices::Out] double% S12);
516 
517  /**
518  * See the documentation for GeodesicExact::Inverse.
519  **********************************************************************/
520  double Inverse(double lat1, double lon1, double lat2, double lon2,
521  [System::Runtime::InteropServices::Out] double% s12);
522 
523  /**
524  * See the documentation for GeodesicExact::Inverse.
525  **********************************************************************/
526  double Inverse(double lat1, double lon1, double lat2, double lon2,
527  [System::Runtime::InteropServices::Out] double% azi1,
528  [System::Runtime::InteropServices::Out] double% azi2);
529 
530  /**
531  * See the documentation for GeodesicExact::Inverse.
532  **********************************************************************/
533  double Inverse(double lat1, double lon1, double lat2, double lon2,
534  [System::Runtime::InteropServices::Out] double% s12,
535  [System::Runtime::InteropServices::Out] double% azi1,
536  [System::Runtime::InteropServices::Out] double% azi2);
537 
538  /**
539  * See the documentation for GeodesicExact::Inverse.
540  **********************************************************************/
541  double Inverse(double lat1, double lon1, double lat2, double lon2,
542  [System::Runtime::InteropServices::Out] double% s12,
543  [System::Runtime::InteropServices::Out] double% azi1,
544  [System::Runtime::InteropServices::Out] double% azi2,
545  [System::Runtime::InteropServices::Out] double% m12);
546 
547  /**
548  * See the documentation for GeodesicExact::Inverse.
549  **********************************************************************/
550  double Inverse(double lat1, double lon1, double lat2, double lon2,
551  [System::Runtime::InteropServices::Out] double% s12,
552  [System::Runtime::InteropServices::Out] double% azi1,
553  [System::Runtime::InteropServices::Out] double% azi2,
554  [System::Runtime::InteropServices::Out] double% M12,
555  [System::Runtime::InteropServices::Out] double% M21);
556 
557  /**
558  * See the documentation for GeodesicExact::Inverse.
559  **********************************************************************/
560  double Inverse(double lat1, double lon1, double lat2, double lon2,
561  [System::Runtime::InteropServices::Out] double% s12,
562  [System::Runtime::InteropServices::Out] double% azi1,
563  [System::Runtime::InteropServices::Out] double% azi2,
564  [System::Runtime::InteropServices::Out] double% m12,
565  [System::Runtime::InteropServices::Out] double% M12,
566  [System::Runtime::InteropServices::Out] double% M21);
567  ///@}
568 
569  /** \name General version of inverse geodesic solution.
570  **********************************************************************/
571  ///@{
572  /**
573  * The general inverse geodesic calculation. GeodesicExact::Inverse is
574  * defined in terms of this function.
575  *
576  * @param[in] lat1 latitude of point 1 (degrees).
577  * @param[in] lon1 longitude of point 1 (degrees).
578  * @param[in] lat2 latitude of point 2 (degrees).
579  * @param[in] lon2 longitude of point 2 (degrees).
580  * @param[in] outmask a bitor'ed combination of GeodesicExact::mask values
581  * specifying which of the following parameters should be set.
582  * @param[out] s12 distance between point 1 and point 2 (meters).
583  * @param[out] azi1 azimuth at point 1 (degrees).
584  * @param[out] azi2 (forward) azimuth at point 2 (degrees).
585  * @param[out] m12 reduced length of geodesic (meters).
586  * @param[out] M12 geodesic scale of point 2 relative to point 1
587  * (dimensionless).
588  * @param[out] M21 geodesic scale of point 1 relative to point 2
589  * (dimensionless).
590  * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
591  * @return \e a12 arc length of between point 1 and point 2 (degrees).
592  *
593  * The GeodesicExact::mask values possible for \e outmask are
594  * - \e outmask |= GeodesicExact::DISTANCE for the distance \e s12;
595  * - \e outmask |= GeodesicExact::AZIMUTH for the latitude \e azi2;
596  * - \e outmask |= GeodesicExact::REDUCEDLENGTH for the reduced length \e
597  * m12;
598  * - \e outmask |= GeodesicExact::GEODESICSCALE for the geodesic scales \e
599  * M12 and \e M21;
600  * - \e outmask |= GeodesicExact::AREA for the area \e S12;
601  * - \e outmask |= GeodesicExact::ALL for all of the above.
602  * .
603  * The arc length is always computed and returned as the function value.
604  **********************************************************************/
605  double GenInverse(double lat1, double lon1, double lat2, double lon2,
606  GeodesicExact::mask outmask,
607  [System::Runtime::InteropServices::Out] double% s12,
608  [System::Runtime::InteropServices::Out] double% azi1,
609  [System::Runtime::InteropServices::Out] double% azi2,
610  [System::Runtime::InteropServices::Out] double% m12,
611  [System::Runtime::InteropServices::Out] double% M12,
612  [System::Runtime::InteropServices::Out] double% M21,
613  [System::Runtime::InteropServices::Out] double% S12);
614  ///@}
615 
616  /** \name Interface to GeodesicLineExact.
617  **********************************************************************/
618  ///@{
619 
620  /**
621  * Set up to compute several points on a single geodesic.
622  *
623  * @param[in] lat1 latitude of point 1 (degrees).
624  * @param[in] lon1 longitude of point 1 (degrees).
625  * @param[in] azi1 azimuth at point 1 (degrees).
626  * @param[in] caps bitor'ed combination of NETGeographicLib::Mask values
627  * specifying the capabilities the GeodesicLineExact object should
628  * possess, i.e., which quantities can be returned in calls to
629  * GeodesicLineExact::Position.
630  * @return a GeodesicLineExact object.
631  *
632  * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 and \e
633  * azi1 should be in the range [&minus;540&deg;, 540&deg;).
634  *
635  * The GeodesicExact::mask values are
636  * - \e caps |= NETGeographicLib::Mask::LATITUDE for the latitude \e lat2; this is
637  * added automatically;
638  * - \e caps |= NETGeographicLib::Mask::LONGITUDE for the latitude \e lon2;
639  * - \e caps |= NETGeographicLib::Mask::AZIMUTH for the azimuth \e azi2; this is
640  * added automatically;
641  * - \e caps |= NETGeographicLib::Mask::DISTANCE for the distance \e s12;
642  * - \e caps |= NETGeographicLib::Mask::REDUCEDLENGTH for the reduced length \e m12;
643  * - \e caps |= NETGeographicLib::Mask::GEODESICSCALE for the geodesic scales \e M12
644  * and \e M21;
645  * - \e caps |= NETGeographicLib::Mask::AREA for the area \e S12;
646  * - \e caps |= NETGeographicLib::Mask::DISTANCE_IN permits the length of the
647  * geodesic to be given in terms of \e s12; without this capability the
648  * length can only be specified in terms of arc length;
649  * - \e caps |= GeodesicExact::ALL for all of the above.
650  * .
651  * The default value of \e caps is GeodesicExact::ALL which turns on all
652  * the capabilities.
653  *
654  * If the point is at a pole, the azimuth is defined by keeping \e lon1
655  * fixed, writing \e lat1 = &plusmn;(90 &minus; &epsilon;), and taking the
656  * limit &epsilon; &rarr; 0+.
657  **********************************************************************/
658  GeodesicLineExact^ Line(double lat1, double lon1, double azi1,
659  NETGeographicLib::Mask caps );
660 
661  ///@}
662 
663  /** \name Inspector functions.
664  **********************************************************************/
665  ///@{
666 
667  /**
668  * @return \e a the equatorial radius of the ellipsoid (meters). This is
669  * the value used in the constructor.
670  **********************************************************************/
671  property double MajorRadius { double get(); }
672 
673  /**
674  * @return \e f the flattening of the ellipsoid. This is the
675  * value used in the constructor.
676  **********************************************************************/
677  property double Flattening { double get(); }
678 
679  /**
680  * @return total area of ellipsoid in meters<sup>2</sup>. The area of a
681  * polygon encircling a pole can be found by adding
682  * GeodesicExact::EllipsoidArea()/2 to the sum of \e S12 for each side of
683  * the polygon.
684  **********************************************************************/
685  property double EllipsoidArea { double get(); }
686  ///@}
687 
688  /**
689  * @return A pointer to the unmanaged GeographicLib::GeodesicExact.
690  *
691  * This function is for internal use only.
692  **********************************************************************/
693  System::IntPtr^ GetUnmanaged();
694  };
695 } // namespace NETGeographicLib
System::IntPtr^ GetUnmanaged()
double Inverse(double lat1, double lon1, double lat2, double lon2, [System::Runtime::InteropServices::Out] double% s12, [System::Runtime::InteropServices::Out] double% azi1, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% m12, [System::Runtime::InteropServices::Out] double% M12, [System::Runtime::InteropServices::Out] double% M21, [System::Runtime::InteropServices::Out] double% S12)
GeodesicLineExact^ Line(double lat1, double lon1, double azi1, NETGeographicLib::Mask caps)
Header for NETGeographicLib::NETGeographicLib objects.
void ArcDirect(double lat1, double lon1, double azi1, double a12, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% s12, [System::Runtime::InteropServices::Out] double% m12, [System::Runtime::InteropServices::Out] double% M12, [System::Runtime::InteropServices::Out] double% M21, [System::Runtime::InteropServices::Out] double% S12)
double Direct(double lat1, double lon1, double azi1, double s12, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% m12, [System::Runtime::InteropServices::Out] double% M12, [System::Runtime::InteropServices::Out] double% M21, [System::Runtime::InteropServices::Out] double% S12)
.NET wrapper for GeographicLib::GeodesicLineExact.
.NET wrapper for GeographicLib::GeodesicExact.
Definition: GeodesicExact.h:86
double GenInverse(double lat1, double lon1, double lat2, double lon2, GeodesicExact::mask outmask, [System::Runtime::InteropServices::Out] double% s12, [System::Runtime::InteropServices::Out] double% azi1, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% m12, [System::Runtime::InteropServices::Out] double% M12, [System::Runtime::InteropServices::Out] double% M21, [System::Runtime::InteropServices::Out] double% S12)
double GenDirect(double lat1, double lon1, double azi1, bool arcmode, double s12_a12, GeodesicExact::mask outmask, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% s12, [System::Runtime::InteropServices::Out] double% m12, [System::Runtime::InteropServices::Out] double% M12, [System::Runtime::InteropServices::Out] double% M21, [System::Runtime::InteropServices::Out] double% S12)