NETGeographicLib  1.43
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_UNROLL
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  * Unroll \e lon2 in the direct calculation. (This flag used to be
168  * called LONG_NOWRAP.)
169  * @hideinitializer
170  **********************************************************************/
171  LONG_UNROLL = 1U<<15,
172  LONG_NOWRAP = LONG_UNROLL,
173  /**
174  * All capabilities, calculate everything. (LONG_UNROLL is not
175  * included in this mask.)
176  * @hideinitializer
177  **********************************************************************/
178  ALL = unsigned(captype::OUT_ALL)| unsigned(captype::CAP_ALL),
179  };
180 
181  /** \name Constructor
182  **********************************************************************/
183  ///@{
184  /**
185  * Constructor for a WGS84 ellipsoid
186  **********************************************************************/
187  GeodesicExact();
188 
189  /**
190  * Constructor for a ellipsoid with
191  *
192  * @param[in] a equatorial radius (meters).
193  * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere.
194  * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening
195  * to 1/\e f.
196  * @exception GeographicErr if \e a or (1 &minus; \e f ) \e a is not
197  * positive.
198  **********************************************************************/
199  GeodesicExact(double a, double f);
200  ///@}
201 
202  /**
203  * The desstructor calls the finalizer.
204  **********************************************************************/
206  { this->!GeodesicExact(); }
207 
208  /** \name Direct geodesic problem specified in terms of distance.
209  **********************************************************************/
210  ///@{
211  /**
212  * Perform the direct geodesic calculation where the length of the geodesic
213  * is specified in terms of distance.
214  *
215  * @param[in] lat1 latitude of point 1 (degrees).
216  * @param[in] lon1 longitude of point 1 (degrees).
217  * @param[in] azi1 azimuth at point 1 (degrees).
218  * @param[in] s12 distance between point 1 and point 2 (meters); it can be
219  * signed.
220  * @param[out] lat2 latitude of point 2 (degrees).
221  * @param[out] lon2 longitude of point 2 (degrees).
222  * @param[out] azi2 (forward) azimuth at point 2 (degrees).
223  * @param[out] m12 reduced length of geodesic (meters).
224  * @param[out] M12 geodesic scale of point 2 relative to point 1
225  * (dimensionless).
226  * @param[out] M21 geodesic scale of point 1 relative to point 2
227  * (dimensionless).
228  * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
229  * @return \e a12 arc length of between point 1 and point 2 (degrees).
230  *
231  * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 and \e
232  * azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of
233  * \e lon2 and \e azi2 returned are in the range [&minus;180&deg;,
234  * 180&deg;).
235  *
236  * If either point is at a pole, the azimuth is defined by keeping the
237  * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;),
238  * and taking the limit &epsilon; &rarr; 0+. An arc length greater that
239  * 180&deg; signifies a geodesic which is not a shortest path. (For a
240  * prolate ellipsoid, an additional condition is necessary for a shortest
241  * path: the longitudinal extent must not exceed of 180&deg;.)
242  *
243  * The following functions are overloaded versions of GeodesicExact::Direct
244  * which omit some of the output parameters. Note, however, that the arc
245  * length is always computed and returned as the function value.
246  **********************************************************************/
247  double Direct(double lat1, double lon1, double azi1, double s12,
248  [System::Runtime::InteropServices::Out] double% lat2,
249  [System::Runtime::InteropServices::Out] double% lon2,
250  [System::Runtime::InteropServices::Out] double% azi2,
251  [System::Runtime::InteropServices::Out] double% m12,
252  [System::Runtime::InteropServices::Out] double% M12,
253  [System::Runtime::InteropServices::Out] double% M21,
254  [System::Runtime::InteropServices::Out] double% S12);
255 
256  /**
257  * See the documentation for GeodesicExact::Direct.
258  **********************************************************************/
259  double Direct(double lat1, double lon1, double azi1, double s12,
260  [System::Runtime::InteropServices::Out] double% lat2,
261  [System::Runtime::InteropServices::Out] double% lon2);
262 
263  /**
264  * See the documentation for GeodesicExact::Direct.
265  **********************************************************************/
266  double Direct(double lat1, double lon1, double azi1, double s12,
267  [System::Runtime::InteropServices::Out] double% lat2,
268  [System::Runtime::InteropServices::Out] double% lon2,
269  [System::Runtime::InteropServices::Out] double% azi2);
270 
271  /**
272  * See the documentation for GeodesicExact::Direct.
273  **********************************************************************/
274  double Direct(double lat1, double lon1, double azi1, double s12,
275  [System::Runtime::InteropServices::Out] double% lat2,
276  [System::Runtime::InteropServices::Out] double% lon2,
277  [System::Runtime::InteropServices::Out] double% azi2,
278  [System::Runtime::InteropServices::Out] double% m12);
279 
280  /**
281  * See the documentation for GeodesicExact::Direct.
282  **********************************************************************/
283  double Direct(double lat1, double lon1, double azi1, double s12,
284  [System::Runtime::InteropServices::Out] double% lat2,
285  [System::Runtime::InteropServices::Out] double% lon2,
286  [System::Runtime::InteropServices::Out] double% azi2,
287  [System::Runtime::InteropServices::Out] double% M12,
288  [System::Runtime::InteropServices::Out] double% M21);
289 
290  /**
291  * See the documentation for GeodesicExact::Direct.
292  **********************************************************************/
293  double Direct(double lat1, double lon1, double azi1, double s12,
294  [System::Runtime::InteropServices::Out] double% lat2,
295  [System::Runtime::InteropServices::Out] double% lon2,
296  [System::Runtime::InteropServices::Out] double% azi2,
297  [System::Runtime::InteropServices::Out] double% m12,
298  [System::Runtime::InteropServices::Out] double% M12,
299  [System::Runtime::InteropServices::Out] double% M21);
300  ///@}
301 
302  /** \name Direct geodesic problem specified in terms of arc length.
303  **********************************************************************/
304  ///@{
305  /**
306  * Perform the direct geodesic calculation where the length of the geodesic
307  * is specified in terms of arc length.
308  *
309  * @param[in] lat1 latitude of point 1 (degrees).
310  * @param[in] lon1 longitude of point 1 (degrees).
311  * @param[in] azi1 azimuth at point 1 (degrees).
312  * @param[in] a12 arc length between point 1 and point 2 (degrees); it can
313  * be signed.
314  * @param[out] lat2 latitude of point 2 (degrees).
315  * @param[out] lon2 longitude of point 2 (degrees).
316  * @param[out] azi2 (forward) azimuth at point 2 (degrees).
317  * @param[out] s12 distance between point 1 and point 2 (meters).
318  * @param[out] m12 reduced length of geodesic (meters).
319  * @param[out] M12 geodesic scale of point 2 relative to point 1
320  * (dimensionless).
321  * @param[out] M21 geodesic scale of point 1 relative to point 2
322  * (dimensionless).
323  * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
324  *
325  * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 and \e
326  * azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of
327  * \e lon2 and \e azi2 returned are in the range [&minus;180&deg;,
328  * 180&deg;).
329  *
330  * If either point is at a pole, the azimuth is defined by keeping the
331  * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;),
332  * and taking the limit &epsilon; &rarr; 0+. An arc length greater that
333  * 180&deg; signifies a geodesic which is not a shortest path. (For a
334  * prolate ellipsoid, an additional condition is necessary for a shortest
335  * path: the longitudinal extent must not exceed of 180&deg;.)
336  *
337  * The following functions are overloaded versions of GeodesicExact::Direct
338  * which omit some of the output parameters.
339  **********************************************************************/
340  void ArcDirect(double lat1, double lon1, double azi1, double a12,
341  [System::Runtime::InteropServices::Out] double% lat2,
342  [System::Runtime::InteropServices::Out] double% lon2,
343  [System::Runtime::InteropServices::Out] double% azi2,
344  [System::Runtime::InteropServices::Out] double% s12,
345  [System::Runtime::InteropServices::Out] double% m12,
346  [System::Runtime::InteropServices::Out] double% M12,
347  [System::Runtime::InteropServices::Out] double% M21,
348  [System::Runtime::InteropServices::Out] double% S12);
349 
350  /**
351  * See the documentation for GeodesicExact::ArcDirect.
352  **********************************************************************/
353  void ArcDirect(double lat1, double lon1, double azi1, double a12,
354  [System::Runtime::InteropServices::Out] double% lat2,
355  [System::Runtime::InteropServices::Out] double% lon2);
356 
357  /**
358  * See the documentation for GeodesicExact::ArcDirect.
359  **********************************************************************/
360  void ArcDirect(double lat1, double lon1, double azi1, double a12,
361  [System::Runtime::InteropServices::Out] double% lat2,
362  [System::Runtime::InteropServices::Out] double% lon2,
363  [System::Runtime::InteropServices::Out] double% azi2);
364 
365  /**
366  * See the documentation for GeodesicExact::ArcDirect.
367  **********************************************************************/
368  void ArcDirect(double lat1, double lon1, double azi1, double a12,
369  [System::Runtime::InteropServices::Out] double% lat2,
370  [System::Runtime::InteropServices::Out] double% lon2,
371  [System::Runtime::InteropServices::Out] double% azi2,
372  [System::Runtime::InteropServices::Out] double% s12);
373 
374  /**
375  * See the documentation for GeodesicExact::ArcDirect.
376  **********************************************************************/
377  void ArcDirect(double lat1, double lon1, double azi1, double a12,
378  [System::Runtime::InteropServices::Out] double% lat2,
379  [System::Runtime::InteropServices::Out] double% lon2,
380  [System::Runtime::InteropServices::Out] double% azi2,
381  [System::Runtime::InteropServices::Out] double% s12,
382  [System::Runtime::InteropServices::Out] double% m12);
383 
384  /**
385  * See the documentation for GeodesicExact::ArcDirect.
386  **********************************************************************/
387  void ArcDirect(double lat1, double lon1, double azi1, double a12,
388  [System::Runtime::InteropServices::Out] double% lat2,
389  [System::Runtime::InteropServices::Out] double% lon2,
390  [System::Runtime::InteropServices::Out] double% azi2,
391  [System::Runtime::InteropServices::Out] double% s12,
392  [System::Runtime::InteropServices::Out] double% M12,
393  [System::Runtime::InteropServices::Out] double% M21);
394 
395  /**
396  * See the documentation for GeodesicExact::ArcDirect.
397  **********************************************************************/
398  void ArcDirect(double lat1, double lon1, double azi1, double a12,
399  [System::Runtime::InteropServices::Out] double% lat2,
400  [System::Runtime::InteropServices::Out] double% lon2,
401  [System::Runtime::InteropServices::Out] double% azi2,
402  [System::Runtime::InteropServices::Out] double% s12,
403  [System::Runtime::InteropServices::Out] double% m12,
404  [System::Runtime::InteropServices::Out] double% M12,
405  [System::Runtime::InteropServices::Out] double% M21);
406  ///@}
407 
408  /** \name General version of the direct geodesic solution.
409  **********************************************************************/
410  ///@{
411 
412  /**
413  * The general direct geodesic calculation. GeodesicExact::Direct and
414  * GeodesicExact::ArcDirect are defined in terms of this function.
415  *
416  * @param[in] lat1 latitude of point 1 (degrees).
417  * @param[in] lon1 longitude of point 1 (degrees).
418  * @param[in] azi1 azimuth at point 1 (degrees).
419  * @param[in] arcmode boolean flag determining the meaning of the second
420  * parameter.
421  * @param[in] s12_a12 if \e arcmode is false, this is the distance between
422  * point 1 and point 2 (meters); otherwise it is the arc length between
423  * point 1 and point 2 (degrees); it can be signed.
424  * @param[in] outmask a bitor'ed combination of GeodesicExact::mask values
425  * specifying which of the following parameters should be set.
426  * @param[out] lat2 latitude of point 2 (degrees).
427  * @param[out] lon2 longitude of point 2 (degrees).
428  * @param[out] azi2 (forward) azimuth at point 2 (degrees).
429  * @param[out] s12 distance between point 1 and point 2 (meters).
430  * @param[out] m12 reduced length of geodesic (meters).
431  * @param[out] M12 geodesic scale of point 2 relative to point 1
432  * (dimensionless).
433  * @param[out] M21 geodesic scale of point 1 relative to point 2
434  * (dimensionless).
435  * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
436  * @return \e a12 arc length of between point 1 and point 2 (degrees).
437  *
438  * The GeodesicExact::mask values possible for \e outmask are
439  * - \e outmask |= GeodesicExact::LATITUDE for the latitude \e lat2;
440  * - \e outmask |= GeodesicExact::LONGITUDE for the latitude \e lon2;
441  * - \e outmask |= GeodesicExact::AZIMUTH for the latitude \e azi2;
442  * - \e outmask |= GeodesicExact::DISTANCE for the distance \e s12;
443  * - \e outmask |= GeodesicExact::REDUCEDLENGTH for the reduced length \e
444  * m12;
445  * - \e outmask |= GeodesicExact::GEODESICSCALE for the geodesic scales \e
446  * M12 and \e M21;
447  * - \e outmask |= GeodesicExact::AREA for the area \e S12;
448  * - \e outmask |= GeodesicExact::ALL for all of the above;
449  * - \e outmask |= GeodesicExact::LONG_UNROLL to unroll \e lon2 instead of
450  * wrapping it into the range [&minus;180&deg;, 180&deg;).
451  * .
452  * The function value \e a12 is always computed and returned and this
453  * equals \e s12_a12 is \e arcmode is true. If \e outmask includes
454  * GeodesicExact::DISTANCE and \e arcmode is false, then \e s12 = \e
455  * s12_a12. It is not necessary to include GeodesicExact::DISTANCE_IN in
456  * \e outmask; this is automatically included is \e arcmode is false.
457  *
458  * With the LONG_UNROLL bit set, the quantity \e lon2 &minus; \e lon1
459  * indicates how many times and in what sense the geodesic encircles
460  * the ellipsoid. Because \e lon2 might be outside the normal allowed
461  * range for longitudes, [&minus;540&deg;, 540&deg;), be sure to
462  * normalize it with Math::AngNormalize2 before using it in other
463  * GeographicLib calls.
464  **********************************************************************/
465  double GenDirect(double lat1, double lon1, double azi1,
466  bool arcmode, double s12_a12, GeodesicExact::mask outmask,
467  [System::Runtime::InteropServices::Out] double% lat2,
468  [System::Runtime::InteropServices::Out] double% lon2,
469  [System::Runtime::InteropServices::Out] double% azi2,
470  [System::Runtime::InteropServices::Out] double% s12,
471  [System::Runtime::InteropServices::Out] double% m12,
472  [System::Runtime::InteropServices::Out] double% M12,
473  [System::Runtime::InteropServices::Out] double% M21,
474  [System::Runtime::InteropServices::Out] double% S12);
475  ///@}
476 
477  /** \name Inverse geodesic problem.
478  **********************************************************************/
479  ///@{
480  /**
481  * Perform the inverse geodesic calculation.
482  *
483  * @param[in] lat1 latitude of point 1 (degrees).
484  * @param[in] lon1 longitude of point 1 (degrees).
485  * @param[in] lat2 latitude of point 2 (degrees).
486  * @param[in] lon2 longitude of point 2 (degrees).
487  * @param[out] s12 distance between point 1 and point 2 (meters).
488  * @param[out] azi1 azimuth at point 1 (degrees).
489  * @param[out] azi2 (forward) azimuth at point 2 (degrees).
490  * @param[out] m12 reduced length of geodesic (meters).
491  * @param[out] M12 geodesic scale of point 2 relative to point 1
492  * (dimensionless).
493  * @param[out] M21 geodesic scale of point 1 relative to point 2
494  * (dimensionless).
495  * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
496  * @return \e a12 arc length of between point 1 and point 2 (degrees).
497  *
498  * \e lat1 and \e lat2 should be in the range [&minus;90&deg;, 90&deg;]; \e
499  * lon1 and \e lon2 should be in the range [&minus;540&deg;, 540&deg;).
500  * The values of \e azi1 and \e azi2 returned are in the range
501  * [&minus;180&deg;, 180&deg;).
502  *
503  * If either point is at a pole, the azimuth is defined by keeping the
504  * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;),
505  * and taking the limit &epsilon; &rarr; 0+.
506  *
507  * The following functions are overloaded versions of GeodesicExact::Inverse
508  * which omit some of the output parameters. Note, however, that the arc
509  * length is always computed and returned as the function value.
510  **********************************************************************/
511  double Inverse(double lat1, double lon1, double lat2, double lon2,
512  [System::Runtime::InteropServices::Out] double% s12,
513  [System::Runtime::InteropServices::Out] double% azi1,
514  [System::Runtime::InteropServices::Out] double% azi2,
515  [System::Runtime::InteropServices::Out] double% m12,
516  [System::Runtime::InteropServices::Out] double% M12,
517  [System::Runtime::InteropServices::Out] double% M21,
518  [System::Runtime::InteropServices::Out] double% S12);
519 
520  /**
521  * See the documentation for GeodesicExact::Inverse.
522  **********************************************************************/
523  double Inverse(double lat1, double lon1, double lat2, double lon2,
524  [System::Runtime::InteropServices::Out] double% s12);
525 
526  /**
527  * See the documentation for GeodesicExact::Inverse.
528  **********************************************************************/
529  double Inverse(double lat1, double lon1, double lat2, double lon2,
530  [System::Runtime::InteropServices::Out] double% azi1,
531  [System::Runtime::InteropServices::Out] double% azi2);
532 
533  /**
534  * See the documentation for GeodesicExact::Inverse.
535  **********************************************************************/
536  double Inverse(double lat1, double lon1, double lat2, double lon2,
537  [System::Runtime::InteropServices::Out] double% s12,
538  [System::Runtime::InteropServices::Out] double% azi1,
539  [System::Runtime::InteropServices::Out] double% azi2);
540 
541  /**
542  * See the documentation for GeodesicExact::Inverse.
543  **********************************************************************/
544  double Inverse(double lat1, double lon1, double lat2, double lon2,
545  [System::Runtime::InteropServices::Out] double% s12,
546  [System::Runtime::InteropServices::Out] double% azi1,
547  [System::Runtime::InteropServices::Out] double% azi2,
548  [System::Runtime::InteropServices::Out] double% m12);
549 
550  /**
551  * See the documentation for GeodesicExact::Inverse.
552  **********************************************************************/
553  double Inverse(double lat1, double lon1, double lat2, double lon2,
554  [System::Runtime::InteropServices::Out] double% s12,
555  [System::Runtime::InteropServices::Out] double% azi1,
556  [System::Runtime::InteropServices::Out] double% azi2,
557  [System::Runtime::InteropServices::Out] double% M12,
558  [System::Runtime::InteropServices::Out] double% M21);
559 
560  /**
561  * See the documentation for GeodesicExact::Inverse.
562  **********************************************************************/
563  double Inverse(double lat1, double lon1, double lat2, double lon2,
564  [System::Runtime::InteropServices::Out] double% s12,
565  [System::Runtime::InteropServices::Out] double% azi1,
566  [System::Runtime::InteropServices::Out] double% azi2,
567  [System::Runtime::InteropServices::Out] double% m12,
568  [System::Runtime::InteropServices::Out] double% M12,
569  [System::Runtime::InteropServices::Out] double% M21);
570  ///@}
571 
572  /** \name General version of inverse geodesic solution.
573  **********************************************************************/
574  ///@{
575  /**
576  * The general inverse geodesic calculation. GeodesicExact::Inverse is
577  * defined in terms of this function.
578  *
579  * @param[in] lat1 latitude of point 1 (degrees).
580  * @param[in] lon1 longitude of point 1 (degrees).
581  * @param[in] lat2 latitude of point 2 (degrees).
582  * @param[in] lon2 longitude of point 2 (degrees).
583  * @param[in] outmask a bitor'ed combination of GeodesicExact::mask values
584  * specifying which of the following parameters should be set.
585  * @param[out] s12 distance between point 1 and point 2 (meters).
586  * @param[out] azi1 azimuth at point 1 (degrees).
587  * @param[out] azi2 (forward) azimuth at point 2 (degrees).
588  * @param[out] m12 reduced length of geodesic (meters).
589  * @param[out] M12 geodesic scale of point 2 relative to point 1
590  * (dimensionless).
591  * @param[out] M21 geodesic scale of point 1 relative to point 2
592  * (dimensionless).
593  * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
594  * @return \e a12 arc length of between point 1 and point 2 (degrees).
595  *
596  * The GeodesicExact::mask values possible for \e outmask are
597  * - \e outmask |= GeodesicExact::DISTANCE for the distance \e s12;
598  * - \e outmask |= GeodesicExact::AZIMUTH for the latitude \e azi2;
599  * - \e outmask |= GeodesicExact::REDUCEDLENGTH for the reduced length \e
600  * m12;
601  * - \e outmask |= GeodesicExact::GEODESICSCALE for the geodesic scales \e
602  * M12 and \e M21;
603  * - \e outmask |= GeodesicExact::AREA for the area \e S12;
604  * - \e outmask |= GeodesicExact::ALL for all of the above.
605  * .
606  * The arc length is always computed and returned as the function value.
607  **********************************************************************/
608  double GenInverse(double lat1, double lon1, double lat2, double lon2,
609  GeodesicExact::mask outmask,
610  [System::Runtime::InteropServices::Out] double% s12,
611  [System::Runtime::InteropServices::Out] double% azi1,
612  [System::Runtime::InteropServices::Out] double% azi2,
613  [System::Runtime::InteropServices::Out] double% m12,
614  [System::Runtime::InteropServices::Out] double% M12,
615  [System::Runtime::InteropServices::Out] double% M21,
616  [System::Runtime::InteropServices::Out] double% S12);
617  ///@}
618 
619  /** \name Interface to GeodesicLineExact.
620  **********************************************************************/
621  ///@{
622 
623  /**
624  * Set up to compute several points on a single geodesic.
625  *
626  * @param[in] lat1 latitude of point 1 (degrees).
627  * @param[in] lon1 longitude of point 1 (degrees).
628  * @param[in] azi1 azimuth at point 1 (degrees).
629  * @param[in] caps bitor'ed combination of NETGeographicLib::Mask values
630  * specifying the capabilities the GeodesicLineExact object should
631  * possess, i.e., which quantities can be returned in calls to
632  * GeodesicLineExact::Position.
633  * @return a GeodesicLineExact object.
634  *
635  * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 and \e
636  * azi1 should be in the range [&minus;540&deg;, 540&deg;).
637  *
638  * The GeodesicExact::mask values are
639  * - \e caps |= NETGeographicLib::Mask::LATITUDE for the latitude \e lat2; this is
640  * added automatically;
641  * - \e caps |= NETGeographicLib::Mask::LONGITUDE for the latitude \e lon2;
642  * - \e caps |= NETGeographicLib::Mask::AZIMUTH for the azimuth \e azi2; this is
643  * added automatically;
644  * - \e caps |= NETGeographicLib::Mask::DISTANCE for the distance \e s12;
645  * - \e caps |= NETGeographicLib::Mask::REDUCEDLENGTH for the reduced length \e m12;
646  * - \e caps |= NETGeographicLib::Mask::GEODESICSCALE for the geodesic scales \e M12
647  * and \e M21;
648  * - \e caps |= NETGeographicLib::Mask::AREA for the area \e S12;
649  * - \e caps |= NETGeographicLib::Mask::DISTANCE_IN permits the length of the
650  * geodesic to be given in terms of \e s12; without this capability the
651  * length can only be specified in terms of arc length;
652  * - \e caps |= GeodesicExact::ALL for all of the above.
653  * .
654  * The default value of \e caps is GeodesicExact::ALL which turns on all
655  * the capabilities.
656  *
657  * If the point is at a pole, the azimuth is defined by keeping \e lon1
658  * fixed, writing \e lat1 = &plusmn;(90 &minus; &epsilon;), and taking the
659  * limit &epsilon; &rarr; 0+.
660  **********************************************************************/
661  GeodesicLineExact^ Line(double lat1, double lon1, double azi1,
662  NETGeographicLib::Mask caps );
663 
664  ///@}
665 
666  /** \name Inspector functions.
667  **********************************************************************/
668  ///@{
669 
670  /**
671  * @return \e a the equatorial radius of the ellipsoid (meters). This is
672  * the value used in the constructor.
673  **********************************************************************/
674  property double MajorRadius { double get(); }
675 
676  /**
677  * @return \e f the flattening of the ellipsoid. This is the
678  * value used in the constructor.
679  **********************************************************************/
680  property double Flattening { double get(); }
681 
682  /**
683  * @return total area of ellipsoid in meters<sup>2</sup>. The area of a
684  * polygon encircling a pole can be found by adding
685  * GeodesicExact::EllipsoidArea()/2 to the sum of \e S12 for each side of
686  * the polygon.
687  **********************************************************************/
688  property double EllipsoidArea { double get(); }
689  ///@}
690 
691  /**
692  * @return A pointer to the unmanaged GeographicLib::GeodesicExact.
693  *
694  * This function is for internal use only.
695  **********************************************************************/
696  System::IntPtr^ GetUnmanaged();
697  };
698 } // 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)