GeographicLib  1.43
GeodesicLine.hpp
Go to the documentation of this file.
1 /**
2  * \file GeodesicLine.hpp
3  * \brief Header for GeographicLib::GeodesicLine class
4  *
5  * Copyright (c) Charles Karney (2009-2014) <charles@karney.com> and licensed
6  * under the MIT/X11 License. For more information, see
7  * http://geographiclib.sourceforge.net/
8  **********************************************************************/
9 
10 #if !defined(GEOGRAPHICLIB_GEODESICLINE_HPP)
11 #define GEOGRAPHICLIB_GEODESICLINE_HPP 1
12 
15 
16 namespace GeographicLib {
17 
18  /**
19  * \brief A geodesic line
20  *
21  * GeodesicLine facilitates the determination of a series of points on a
22  * single geodesic. The starting point (\e lat1, \e lon1) and the azimuth \e
23  * azi1 are specified in the constructor. GeodesicLine.Position returns the
24  * location of point 2 a distance \e s12 along the geodesic. Alternatively
25  * GeodesicLine.ArcPosition gives the position of point 2 an arc length \e
26  * a12 along the geodesic.
27  *
28  * The default copy constructor and assignment operators work with this
29  * class. Similarly, a vector can be used to hold GeodesicLine objects.
30  *
31  * The calculations are accurate to better than 15 nm (15 nanometers). See
32  * Sec. 9 of
33  * <a href="http://arxiv.org/abs/1102.1215v1">arXiv:1102.1215v1</a> for
34  * details. The algorithms used by this class are based on series expansions
35  * using the flattening \e f as a small parameter. These are only accurate
36  * for |<i>f</i>| &lt; 0.02; however reasonably accurate results will be
37  * obtained for |<i>f</i>| &lt; 0.2. For very eccentric ellipsoids, use
38  * GeodesicLineExact instead.
39  *
40  * The algorithms are described in
41  * - C. F. F. Karney,
42  * <a href="https://dx.doi.org/10.1007/s00190-012-0578-z">
43  * Algorithms for geodesics</a>,
44  * J. Geodesy <b>87</b>, 43--55 (2013);
45  * DOI: <a href="https://dx.doi.org/10.1007/s00190-012-0578-z">
46  * 10.1007/s00190-012-0578-z</a>;
47  * addenda: <a href="http://geographiclib.sf.net/geod-addenda.html">
48  * geod-addenda.html</a>.
49  * .
50  * For more information on geodesics see \ref geodesic.
51  *
52  * Example of use:
53  * \include example-GeodesicLine.cpp
54  *
55  * <a href="GeodSolve.1.html">GeodSolve</a> is a command-line utility
56  * providing access to the functionality of Geodesic and GeodesicLine.
57  **********************************************************************/
58 
60  private:
61  typedef Math::real real;
62  friend class Geodesic;
63  static const int nC1_ = Geodesic::nC1_;
64  static const int nC1p_ = Geodesic::nC1p_;
65  static const int nC2_ = Geodesic::nC2_;
66  static const int nC3_ = Geodesic::nC3_;
67  static const int nC4_ = Geodesic::nC4_;
68 
69  real tiny_;
70  real _lat1, _lon1, _azi1;
71  real _a, _f, _b, _c2, _f1, _salp0, _calp0, _k2,
72  _salp1, _calp1, _ssig1, _csig1, _dn1, _stau1, _ctau1, _somg1, _comg1,
73  _A1m1, _A2m1, _A3c, _B11, _B21, _B31, _A4, _B41;
74  // index zero elements of _C1a, _C1pa, _C2a, _C3a are unused
75  real _C1a[nC1_ + 1], _C1pa[nC1p_ + 1], _C2a[nC2_ + 1], _C3a[nC3_],
76  _C4a[nC4_]; // all the elements of _C4a are used
77  unsigned _caps;
78 
79  enum captype {
80  CAP_NONE = Geodesic::CAP_NONE,
81  CAP_C1 = Geodesic::CAP_C1,
82  CAP_C1p = Geodesic::CAP_C1p,
83  CAP_C2 = Geodesic::CAP_C2,
84  CAP_C3 = Geodesic::CAP_C3,
85  CAP_C4 = Geodesic::CAP_C4,
86  CAP_ALL = Geodesic::CAP_ALL,
87  CAP_MASK = Geodesic::CAP_MASK,
88  OUT_ALL = Geodesic::OUT_ALL,
89  OUT_MASK = Geodesic::OUT_MASK,
90  };
91  public:
92 
93  /**
94  * Bit masks for what calculations to do. They signify to the
95  * GeodesicLine::GeodesicLine constructor and to Geodesic::Line what
96  * capabilities should be included in the GeodesicLine object. This is
97  * merely a duplication of Geodesic::mask.
98  **********************************************************************/
99  enum mask {
100  /**
101  * No capabilities, no output.
102  * @hideinitializer
103  **********************************************************************/
105  /**
106  * Calculate latitude \e lat2. (It's not necessary to include this as a
107  * capability to GeodesicLine because this is included by default.)
108  * @hideinitializer
109  **********************************************************************/
110  LATITUDE = Geodesic::LATITUDE,
111  /**
112  * Calculate longitude \e lon2.
113  * @hideinitializer
114  **********************************************************************/
115  LONGITUDE = Geodesic::LONGITUDE,
116  /**
117  * Calculate azimuths \e azi1 and \e azi2. (It's not necessary to
118  * include this as a capability to GeodesicLine because this is included
119  * by default.)
120  * @hideinitializer
121  **********************************************************************/
122  AZIMUTH = Geodesic::AZIMUTH,
123  /**
124  * Calculate distance \e s12.
125  * @hideinitializer
126  **********************************************************************/
127  DISTANCE = Geodesic::DISTANCE,
128  /**
129  * Allow distance \e s12 to be used as input in the direct geodesic
130  * problem.
131  * @hideinitializer
132  **********************************************************************/
133  DISTANCE_IN = Geodesic::DISTANCE_IN,
134  /**
135  * Calculate reduced length \e m12.
136  * @hideinitializer
137  **********************************************************************/
138  REDUCEDLENGTH = Geodesic::REDUCEDLENGTH,
139  /**
140  * Calculate geodesic scales \e M12 and \e M21.
141  * @hideinitializer
142  **********************************************************************/
143  GEODESICSCALE = Geodesic::GEODESICSCALE,
144  /**
145  * Calculate area \e S12.
146  * @hideinitializer
147  **********************************************************************/
149  /**
150  * Unroll \e lon2 in the direct calculation. (This flag used to be
151  * called LONG_NOWRAP.)
152  * @hideinitializer
153  **********************************************************************/
154  LONG_UNROLL = Geodesic::LONG_UNROLL,
155  /// \cond SKIP
156  LONG_NOWRAP = LONG_UNROLL,
157  /// \endcond
158  /**
159  * All capabilities, calculate everything. (LONG_UNROLL is not
160  * included in this mask.)
161  * @hideinitializer
162  **********************************************************************/
164  };
165 
166  /** \name Constructors
167  **********************************************************************/
168  ///@{
169 
170  /**
171  * Constructor for a geodesic line staring at latitude \e lat1, longitude
172  * \e lon1, and azimuth \e azi1 (all in degrees).
173  *
174  * @param[in] g A Geodesic object used to compute the necessary information
175  * about the GeodesicLine.
176  * @param[in] lat1 latitude of point 1 (degrees).
177  * @param[in] lon1 longitude of point 1 (degrees).
178  * @param[in] azi1 azimuth at point 1 (degrees).
179  * @param[in] caps bitor'ed combination of GeodesicLine::mask values
180  * specifying the capabilities the GeodesicLine object should possess,
181  * i.e., which quantities can be returned in calls to
182  * GeodesicLine::Position.
183  *
184  * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 and \e
185  * azi1 should be in the range [&minus;540&deg;, 540&deg;).
186  *
187  * The GeodesicLine::mask values are
188  * - \e caps |= GeodesicLine::LATITUDE for the latitude \e lat2; this is
189  * added automatically;
190  * - \e caps |= GeodesicLine::LONGITUDE for the latitude \e lon2;
191  * - \e caps |= GeodesicLine::AZIMUTH for the latitude \e azi2; this is
192  * added automatically;
193  * - \e caps |= GeodesicLine::DISTANCE for the distance \e s12;
194  * - \e caps |= GeodesicLine::REDUCEDLENGTH for the reduced length \e m12;
195  * - \e caps |= GeodesicLine::GEODESICSCALE for the geodesic scales \e M12
196  * and \e M21;
197  * - \e caps |= GeodesicLine::AREA for the area \e S12;
198  * - \e caps |= GeodesicLine::DISTANCE_IN permits the length of the
199  * geodesic to be given in terms of \e s12; without this capability the
200  * length can only be specified in terms of arc length;
201  * - \e caps |= GeodesicLine::ALL for all of the above.
202  * .
203  * The default value of \e caps is GeodesicLine::ALL.
204  *
205  * If the point is at a pole, the azimuth is defined by keeping \e lon1
206  * fixed, writing \e lat1 = &plusmn;(90&deg; &minus; &epsilon;), and taking
207  * the limit &epsilon; &rarr; 0+.
208  **********************************************************************/
209  GeodesicLine(const Geodesic& g, real lat1, real lon1, real azi1,
210  unsigned caps = ALL);
211 
212  /**
213  * A default constructor. If GeodesicLine::Position is called on the
214  * resulting object, it returns immediately (without doing any
215  * calculations). The object can be set with a call to Geodesic::Line.
216  * Use Init() to test whether object is still in this uninitialized state.
217  **********************************************************************/
218  GeodesicLine() : _caps(0U) {}
219  ///@}
220 
221  /** \name Position in terms of distance
222  **********************************************************************/
223  ///@{
224 
225  /**
226  * Compute the position of point 2 which is a distance \e s12 (meters) from
227  * point 1.
228  *
229  * @param[in] s12 distance between point 1 and point 2 (meters); it can be
230  * negative.
231  * @param[out] lat2 latitude of point 2 (degrees).
232  * @param[out] lon2 longitude of point 2 (degrees); requires that the
233  * GeodesicLine object was constructed with \e caps |=
234  * GeodesicLine::LONGITUDE.
235  * @param[out] azi2 (forward) azimuth at point 2 (degrees).
236  * @param[out] m12 reduced length of geodesic (meters); requires that the
237  * GeodesicLine object was constructed with \e caps |=
238  * GeodesicLine::REDUCEDLENGTH.
239  * @param[out] M12 geodesic scale of point 2 relative to point 1
240  * (dimensionless); requires that the GeodesicLine object was constructed
241  * with \e caps |= GeodesicLine::GEODESICSCALE.
242  * @param[out] M21 geodesic scale of point 1 relative to point 2
243  * (dimensionless); requires that the GeodesicLine object was constructed
244  * with \e caps |= GeodesicLine::GEODESICSCALE.
245  * @param[out] S12 area under the geodesic (meters<sup>2</sup>); requires
246  * that the GeodesicLine object was constructed with \e caps |=
247  * GeodesicLine::AREA.
248  * @return \e a12 arc length of between point 1 and point 2 (degrees).
249  *
250  * The values of \e lon2 and \e azi2 returned are in the range
251  * [&minus;180&deg;, 180&deg;).
252  *
253  * The GeodesicLine object \e must have been constructed with \e caps |=
254  * GeodesicLine::DISTANCE_IN; otherwise Math::NaN() is returned and no
255  * parameters are set. Requesting a value which the GeodesicLine object is
256  * not capable of computing is not an error; the corresponding argument
257  * will not be altered.
258  *
259  * The following functions are overloaded versions of
260  * GeodesicLine::Position which omit some of the output parameters. Note,
261  * however, that the arc length is always computed and returned as the
262  * function value.
263  **********************************************************************/
265  real& lat2, real& lon2, real& azi2,
266  real& m12, real& M12, real& M21,
267  real& S12) const {
268  real t;
269  return GenPosition(false, s12,
270  LATITUDE | LONGITUDE | AZIMUTH |
271  REDUCEDLENGTH | GEODESICSCALE | AREA,
272  lat2, lon2, azi2, t, m12, M12, M21, S12);
273  }
274 
275  /**
276  * See the documentation for GeodesicLine::Position.
277  **********************************************************************/
278  Math::real Position(real s12, real& lat2, real& lon2) const {
279  real t;
280  return GenPosition(false, s12,
281  LATITUDE | LONGITUDE,
282  lat2, lon2, t, t, t, t, t, t);
283  }
284 
285  /**
286  * See the documentation for GeodesicLine::Position.
287  **********************************************************************/
288  Math::real Position(real s12, real& lat2, real& lon2,
289  real& azi2) const {
290  real t;
291  return GenPosition(false, s12,
292  LATITUDE | LONGITUDE | AZIMUTH,
293  lat2, lon2, azi2, t, t, t, t, t);
294  }
295 
296  /**
297  * See the documentation for GeodesicLine::Position.
298  **********************************************************************/
299  Math::real Position(real s12, real& lat2, real& lon2,
300  real& azi2, real& m12) const {
301  real t;
302  return GenPosition(false, s12,
303  LATITUDE | LONGITUDE |
304  AZIMUTH | REDUCEDLENGTH,
305  lat2, lon2, azi2, t, m12, t, t, t);
306  }
307 
308  /**
309  * See the documentation for GeodesicLine::Position.
310  **********************************************************************/
311  Math::real Position(real s12, real& lat2, real& lon2,
312  real& azi2, real& M12, real& M21)
313  const {
314  real t;
315  return GenPosition(false, s12,
316  LATITUDE | LONGITUDE |
317  AZIMUTH | GEODESICSCALE,
318  lat2, lon2, azi2, t, t, M12, M21, t);
319  }
320 
321  /**
322  * See the documentation for GeodesicLine::Position.
323  **********************************************************************/
325  real& lat2, real& lon2, real& azi2,
326  real& m12, real& M12, real& M21)
327  const {
328  real t;
329  return GenPosition(false, s12,
330  LATITUDE | LONGITUDE | AZIMUTH |
331  REDUCEDLENGTH | GEODESICSCALE,
332  lat2, lon2, azi2, t, m12, M12, M21, t);
333  }
334 
335  ///@}
336 
337  /** \name Position in terms of arc length
338  **********************************************************************/
339  ///@{
340 
341  /**
342  * Compute the position of point 2 which is an arc length \e a12 (degrees)
343  * from point 1.
344  *
345  * @param[in] a12 arc length between point 1 and point 2 (degrees); it can
346  * be negative.
347  * @param[out] lat2 latitude of point 2 (degrees).
348  * @param[out] lon2 longitude of point 2 (degrees); requires that the
349  * GeodesicLine object was constructed with \e caps |=
350  * GeodesicLine::LONGITUDE.
351  * @param[out] azi2 (forward) azimuth at point 2 (degrees).
352  * @param[out] s12 distance between point 1 and point 2 (meters); requires
353  * that the GeodesicLine object was constructed with \e caps |=
354  * GeodesicLine::DISTANCE.
355  * @param[out] m12 reduced length of geodesic (meters); requires that the
356  * GeodesicLine object was constructed with \e caps |=
357  * GeodesicLine::REDUCEDLENGTH.
358  * @param[out] M12 geodesic scale of point 2 relative to point 1
359  * (dimensionless); requires that the GeodesicLine object was constructed
360  * with \e caps |= GeodesicLine::GEODESICSCALE.
361  * @param[out] M21 geodesic scale of point 1 relative to point 2
362  * (dimensionless); requires that the GeodesicLine object was constructed
363  * with \e caps |= GeodesicLine::GEODESICSCALE.
364  * @param[out] S12 area under the geodesic (meters<sup>2</sup>); requires
365  * that the GeodesicLine object was constructed with \e caps |=
366  * GeodesicLine::AREA.
367  *
368  * The values of \e lon2 and \e azi2 returned are in the range
369  * [&minus;180&deg;, 180&deg;).
370  *
371  * Requesting a value which the GeodesicLine object is not capable of
372  * computing is not an error; the corresponding argument will not be
373  * altered.
374  *
375  * The following functions are overloaded versions of
376  * GeodesicLine::ArcPosition which omit some of the output parameters.
377  **********************************************************************/
378  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
379  real& s12, real& m12, real& M12, real& M21,
380  real& S12) const {
381  GenPosition(true, a12,
382  LATITUDE | LONGITUDE | AZIMUTH | DISTANCE |
383  REDUCEDLENGTH | GEODESICSCALE | AREA,
384  lat2, lon2, azi2, s12, m12, M12, M21, S12);
385  }
386 
387  /**
388  * See the documentation for GeodesicLine::ArcPosition.
389  **********************************************************************/
390  void ArcPosition(real a12, real& lat2, real& lon2)
391  const {
392  real t;
393  GenPosition(true, a12,
394  LATITUDE | LONGITUDE,
395  lat2, lon2, t, t, t, t, t, t);
396  }
397 
398  /**
399  * See the documentation for GeodesicLine::ArcPosition.
400  **********************************************************************/
401  void ArcPosition(real a12,
402  real& lat2, real& lon2, real& azi2)
403  const {
404  real t;
405  GenPosition(true, a12,
406  LATITUDE | LONGITUDE | AZIMUTH,
407  lat2, lon2, azi2, t, t, t, t, t);
408  }
409 
410  /**
411  * See the documentation for GeodesicLine::ArcPosition.
412  **********************************************************************/
413  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
414  real& s12) const {
415  real t;
416  GenPosition(true, a12,
417  LATITUDE | LONGITUDE | AZIMUTH | DISTANCE,
418  lat2, lon2, azi2, s12, t, t, t, t);
419  }
420 
421  /**
422  * See the documentation for GeodesicLine::ArcPosition.
423  **********************************************************************/
424  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
425  real& s12, real& m12) const {
426  real t;
427  GenPosition(true, a12,
428  LATITUDE | LONGITUDE | AZIMUTH |
429  DISTANCE | REDUCEDLENGTH,
430  lat2, lon2, azi2, s12, m12, t, t, t);
431  }
432 
433  /**
434  * See the documentation for GeodesicLine::ArcPosition.
435  **********************************************************************/
436  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
437  real& s12, real& M12, real& M21)
438  const {
439  real t;
440  GenPosition(true, a12,
441  LATITUDE | LONGITUDE | AZIMUTH |
442  DISTANCE | GEODESICSCALE,
443  lat2, lon2, azi2, s12, t, M12, M21, t);
444  }
445 
446  /**
447  * See the documentation for GeodesicLine::ArcPosition.
448  **********************************************************************/
449  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
450  real& s12, real& m12, real& M12, real& M21)
451  const {
452  real t;
453  GenPosition(true, a12,
454  LATITUDE | LONGITUDE | AZIMUTH |
455  DISTANCE | REDUCEDLENGTH | GEODESICSCALE,
456  lat2, lon2, azi2, s12, m12, M12, M21, t);
457  }
458  ///@}
459 
460  /** \name The general position function.
461  **********************************************************************/
462  ///@{
463 
464  /**
465  * The general position function. GeodesicLine::Position and
466  * GeodesicLine::ArcPosition are defined in terms of this function.
467  *
468  * @param[in] arcmode boolean flag determining the meaning of the second
469  * parameter; if arcmode is false, then the GeodesicLine object must have
470  * been constructed with \e caps |= GeodesicLine::DISTANCE_IN.
471  * @param[in] s12_a12 if \e arcmode is false, this is the distance between
472  * point 1 and point 2 (meters); otherwise it is the arc length between
473  * point 1 and point 2 (degrees); it can be negative.
474  * @param[in] outmask a bitor'ed combination of GeodesicLine::mask values
475  * specifying which of the following parameters should be set.
476  * @param[out] lat2 latitude of point 2 (degrees).
477  * @param[out] lon2 longitude of point 2 (degrees); requires that the
478  * GeodesicLine object was constructed with \e caps |=
479  * GeodesicLine::LONGITUDE.
480  * @param[out] azi2 (forward) azimuth at point 2 (degrees).
481  * @param[out] s12 distance between point 1 and point 2 (meters); requires
482  * that the GeodesicLine object was constructed with \e caps |=
483  * GeodesicLine::DISTANCE.
484  * @param[out] m12 reduced length of geodesic (meters); requires that the
485  * GeodesicLine object was constructed with \e caps |=
486  * GeodesicLine::REDUCEDLENGTH.
487  * @param[out] M12 geodesic scale of point 2 relative to point 1
488  * (dimensionless); requires that the GeodesicLine object was constructed
489  * with \e caps |= GeodesicLine::GEODESICSCALE.
490  * @param[out] M21 geodesic scale of point 1 relative to point 2
491  * (dimensionless); requires that the GeodesicLine object was constructed
492  * with \e caps |= GeodesicLine::GEODESICSCALE.
493  * @param[out] S12 area under the geodesic (meters<sup>2</sup>); requires
494  * that the GeodesicLine object was constructed with \e caps |=
495  * GeodesicLine::AREA.
496  * @return \e a12 arc length of between point 1 and point 2 (degrees).
497  *
498  * The GeodesicLine::mask values possible for \e outmask are
499  * - \e outmask |= GeodesicLine::LATITUDE for the latitude \e lat2;
500  * - \e outmask |= GeodesicLine::LONGITUDE for the latitude \e lon2;
501  * - \e outmask |= GeodesicLine::AZIMUTH for the latitude \e azi2;
502  * - \e outmask |= GeodesicLine::DISTANCE for the distance \e s12;
503  * - \e outmask |= GeodesicLine::REDUCEDLENGTH for the reduced length \e
504  * m12;
505  * - \e outmask |= GeodesicLine::GEODESICSCALE for the geodesic scales \e
506  * M12 and \e M21;
507  * - \e outmask |= GeodesicLine::AREA for the area \e S12;
508  * - \e outmask |= GeodesicLine::ALL for all of the above;
509  * - \e outmask |= GeodesicLine::LONG_UNROLL to unroll \e lon2 instead of
510  * reducing it into the range [&minus;180&deg;, 180&deg;).
511  * .
512  * Requesting a value which the GeodesicLine object is not capable of
513  * computing is not an error; the corresponding argument will not be
514  * altered. Note, however, that the arc length is always computed and
515  * returned as the function value.
516  *
517  * With the GeodesicLine::LONG_UNROLL bit set, the quantity \e lon2 &minus;
518  * \e lon1 indicates how many times and in what sense the geodesic
519  * encircles the ellipsoid. Because \e lon2 might be outside the normal
520  * allowed range for longitudes, [&minus;540&deg;, 540&deg;), be sure to
521  * normalize it with Math::AngNormalize2 before using it in other
522  * GeographicLib calls.
523  **********************************************************************/
524  Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask,
525  real& lat2, real& lon2, real& azi2,
526  real& s12, real& m12, real& M12, real& M21,
527  real& S12) const;
528 
529  ///@}
530 
531  /** \name Inspector functions
532  **********************************************************************/
533  ///@{
534 
535  /**
536  * @return true if the object has been initialized.
537  **********************************************************************/
538  bool Init() const { return _caps != 0U; }
539 
540  /**
541  * @return \e lat1 the latitude of point 1 (degrees).
542  **********************************************************************/
544  { return Init() ? _lat1 : Math::NaN(); }
545 
546  /**
547  * @return \e lon1 the longitude of point 1 (degrees).
548  **********************************************************************/
550  { return Init() ? _lon1 : Math::NaN(); }
551 
552  /**
553  * @return \e azi1 the azimuth (degrees) of the geodesic line at point 1.
554  **********************************************************************/
556  { return Init() ? _azi1 : Math::NaN(); }
557 
558  /**
559  * @return \e azi0 the azimuth (degrees) of the geodesic line as it crosses
560  * the equator in a northward direction.
561  **********************************************************************/
563  using std::atan2;
564  return Init() ?
565  atan2(_salp0, _calp0) / Math::degree() : Math::NaN();
566  }
567 
568  /**
569  * @return \e a1 the arc length (degrees) between the northward equatorial
570  * crossing and point 1.
571  **********************************************************************/
573  using std::atan2;
574  return Init() ?
575  atan2(_ssig1, _csig1) / Math::degree() : Math::NaN();
576  }
577 
578  /**
579  * @return \e a the equatorial radius of the ellipsoid (meters). This is
580  * the value inherited from the Geodesic object used in the constructor.
581  **********************************************************************/
583  { return Init() ? _a : Math::NaN(); }
584 
585  /**
586  * @return \e f the flattening of the ellipsoid. This is the value
587  * inherited from the Geodesic object used in the constructor.
588  **********************************************************************/
590  { return Init() ? _f : Math::NaN(); }
591 
592  /// \cond SKIP
593  /**
594  * <b>DEPRECATED</b>
595  * @return \e r the inverse flattening of the ellipsoid.
596  **********************************************************************/
597  Math::real InverseFlattening() const
598  { return Init() ? 1/_f : Math::NaN(); }
599  /// \endcond
600 
601  /**
602  * @return \e caps the computational capabilities that this object was
603  * constructed with. LATITUDE and AZIMUTH are always included.
604  **********************************************************************/
605  unsigned Capabilities() const { return _caps; }
606 
607  /**
608  * @param[in] testcaps a set of bitor'ed GeodesicLine::mask values.
609  * @return true if the GeodesicLine object has all these capabilities.
610  **********************************************************************/
611  bool Capabilities(unsigned testcaps) const {
612  testcaps &= OUT_ALL;
613  return (_caps & testcaps) == testcaps;
614  }
615  ///@}
616 
617  };
618 
619 } // namespace GeographicLib
620 
621 #endif // GEOGRAPHICLIB_GEODESICLINE_HPP
Math::real Position(real s12, real &lat2, real &lon2, real &azi2) const
static T NaN()
Definition: Math.hpp:629
Math::real MajorRadius() const
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:90
GeographicLib::Math::real real
Definition: GeodSolve.cpp:32
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12, real &M12, real &M21, real &S12) const
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2) const
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12) const
Math::real Flattening() const
Header for GeographicLib::Geodesic class.
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12, real &M12, real &M21) const
void ArcPosition(real a12, real &lat2, real &lon2) const
Math::real Longitude() const
Namespace for GeographicLib.
Definition: Accumulator.cpp:12
Math::real EquatorialArc() const
Math::real Latitude() const
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12) const
static T degree()
Definition: Math.hpp:228
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12) const
unsigned Capabilities() const
Math::real Azimuth() const
bool Capabilities(unsigned testcaps) const
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &M12, real &M21) const
Header for GeographicLib::Constants class.
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12, real &M12, real &M21) const
Math::real Position(real s12, real &lat2, real &lon2) const
Math::real EquatorialAzimuth() const
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12, real &M12, real &M21, real &S12) const
Geodesic calculations
Definition: Geodesic.hpp:171
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &M12, real &M21) const