GeographicLib  1.44
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-2015) <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;].
185  *
186  * The GeodesicLine::mask values are
187  * - \e caps |= GeodesicLine::LATITUDE for the latitude \e lat2; this is
188  * added automatically;
189  * - \e caps |= GeodesicLine::LONGITUDE for the latitude \e lon2;
190  * - \e caps |= GeodesicLine::AZIMUTH for the latitude \e azi2; this is
191  * added automatically;
192  * - \e caps |= GeodesicLine::DISTANCE for the distance \e s12;
193  * - \e caps |= GeodesicLine::REDUCEDLENGTH for the reduced length \e m12;
194  * - \e caps |= GeodesicLine::GEODESICSCALE for the geodesic scales \e M12
195  * and \e M21;
196  * - \e caps |= GeodesicLine::AREA for the area \e S12;
197  * - \e caps |= GeodesicLine::DISTANCE_IN permits the length of the
198  * geodesic to be given in terms of \e s12; without this capability the
199  * length can only be specified in terms of arc length;
200  * - \e caps |= GeodesicLine::ALL for all of the above.
201  * .
202  * The default value of \e caps is GeodesicLine::ALL.
203  *
204  * If the point is at a pole, the azimuth is defined by keeping \e lon1
205  * fixed, writing \e lat1 = &plusmn;(90&deg; &minus; &epsilon;), and taking
206  * the limit &epsilon; &rarr; 0+.
207  **********************************************************************/
208  GeodesicLine(const Geodesic& g, real lat1, real lon1, real azi1,
209  unsigned caps = ALL);
210 
211  /**
212  * A default constructor. If GeodesicLine::Position is called on the
213  * resulting object, it returns immediately (without doing any
214  * calculations). The object can be set with a call to Geodesic::Line.
215  * Use Init() to test whether object is still in this uninitialized state.
216  **********************************************************************/
217  GeodesicLine() : _caps(0U) {}
218  ///@}
219 
220  /** \name Position in terms of distance
221  **********************************************************************/
222  ///@{
223 
224  /**
225  * Compute the position of point 2 which is a distance \e s12 (meters) from
226  * point 1.
227  *
228  * @param[in] s12 distance between point 1 and point 2 (meters); it can be
229  * negative.
230  * @param[out] lat2 latitude of point 2 (degrees).
231  * @param[out] lon2 longitude of point 2 (degrees); requires that the
232  * GeodesicLine object was constructed with \e caps |=
233  * GeodesicLine::LONGITUDE.
234  * @param[out] azi2 (forward) azimuth at point 2 (degrees).
235  * @param[out] m12 reduced length of geodesic (meters); requires that the
236  * GeodesicLine object was constructed with \e caps |=
237  * GeodesicLine::REDUCEDLENGTH.
238  * @param[out] M12 geodesic scale of point 2 relative to point 1
239  * (dimensionless); requires that the GeodesicLine object was constructed
240  * with \e caps |= GeodesicLine::GEODESICSCALE.
241  * @param[out] M21 geodesic scale of point 1 relative to point 2
242  * (dimensionless); requires that the GeodesicLine object was constructed
243  * with \e caps |= GeodesicLine::GEODESICSCALE.
244  * @param[out] S12 area under the geodesic (meters<sup>2</sup>); requires
245  * that the GeodesicLine object was constructed with \e caps |=
246  * GeodesicLine::AREA.
247  * @return \e a12 arc length of between point 1 and point 2 (degrees).
248  *
249  * The values of \e lon2 and \e azi2 returned are in the range
250  * [&minus;180&deg;, 180&deg;).
251  *
252  * The GeodesicLine object \e must have been constructed with \e caps |=
253  * GeodesicLine::DISTANCE_IN; otherwise Math::NaN() is returned and no
254  * parameters are set. Requesting a value which the GeodesicLine object is
255  * not capable of computing is not an error; the corresponding argument
256  * will not be altered.
257  *
258  * The following functions are overloaded versions of
259  * GeodesicLine::Position which omit some of the output parameters. Note,
260  * however, that the arc length is always computed and returned as the
261  * function value.
262  **********************************************************************/
264  real& lat2, real& lon2, real& azi2,
265  real& m12, real& M12, real& M21,
266  real& S12) const {
267  real t;
268  return GenPosition(false, s12,
269  LATITUDE | LONGITUDE | AZIMUTH |
270  REDUCEDLENGTH | GEODESICSCALE | AREA,
271  lat2, lon2, azi2, t, m12, M12, M21, S12);
272  }
273 
274  /**
275  * See the documentation for GeodesicLine::Position.
276  **********************************************************************/
277  Math::real Position(real s12, real& lat2, real& lon2) const {
278  real t;
279  return GenPosition(false, s12,
280  LATITUDE | LONGITUDE,
281  lat2, lon2, t, t, t, t, t, t);
282  }
283 
284  /**
285  * See the documentation for GeodesicLine::Position.
286  **********************************************************************/
287  Math::real Position(real s12, real& lat2, real& lon2,
288  real& azi2) const {
289  real t;
290  return GenPosition(false, s12,
291  LATITUDE | LONGITUDE | AZIMUTH,
292  lat2, lon2, azi2, t, t, t, t, t);
293  }
294 
295  /**
296  * See the documentation for GeodesicLine::Position.
297  **********************************************************************/
298  Math::real Position(real s12, real& lat2, real& lon2,
299  real& azi2, real& m12) const {
300  real t;
301  return GenPosition(false, s12,
302  LATITUDE | LONGITUDE |
303  AZIMUTH | REDUCEDLENGTH,
304  lat2, lon2, azi2, t, m12, t, t, t);
305  }
306 
307  /**
308  * See the documentation for GeodesicLine::Position.
309  **********************************************************************/
310  Math::real Position(real s12, real& lat2, real& lon2,
311  real& azi2, real& M12, real& M21)
312  const {
313  real t;
314  return GenPosition(false, s12,
315  LATITUDE | LONGITUDE |
316  AZIMUTH | GEODESICSCALE,
317  lat2, lon2, azi2, t, t, M12, M21, t);
318  }
319 
320  /**
321  * See the documentation for GeodesicLine::Position.
322  **********************************************************************/
324  real& lat2, real& lon2, real& azi2,
325  real& m12, real& M12, real& M21)
326  const {
327  real t;
328  return GenPosition(false, s12,
329  LATITUDE | LONGITUDE | AZIMUTH |
330  REDUCEDLENGTH | GEODESICSCALE,
331  lat2, lon2, azi2, t, m12, M12, M21, t);
332  }
333 
334  ///@}
335 
336  /** \name Position in terms of arc length
337  **********************************************************************/
338  ///@{
339 
340  /**
341  * Compute the position of point 2 which is an arc length \e a12 (degrees)
342  * from point 1.
343  *
344  * @param[in] a12 arc length between point 1 and point 2 (degrees); it can
345  * be negative.
346  * @param[out] lat2 latitude of point 2 (degrees).
347  * @param[out] lon2 longitude of point 2 (degrees); requires that the
348  * GeodesicLine object was constructed with \e caps |=
349  * GeodesicLine::LONGITUDE.
350  * @param[out] azi2 (forward) azimuth at point 2 (degrees).
351  * @param[out] s12 distance between point 1 and point 2 (meters); requires
352  * that the GeodesicLine object was constructed with \e caps |=
353  * GeodesicLine::DISTANCE.
354  * @param[out] m12 reduced length of geodesic (meters); requires that the
355  * GeodesicLine object was constructed with \e caps |=
356  * GeodesicLine::REDUCEDLENGTH.
357  * @param[out] M12 geodesic scale of point 2 relative to point 1
358  * (dimensionless); requires that the GeodesicLine object was constructed
359  * with \e caps |= GeodesicLine::GEODESICSCALE.
360  * @param[out] M21 geodesic scale of point 1 relative to point 2
361  * (dimensionless); requires that the GeodesicLine object was constructed
362  * with \e caps |= GeodesicLine::GEODESICSCALE.
363  * @param[out] S12 area under the geodesic (meters<sup>2</sup>); requires
364  * that the GeodesicLine object was constructed with \e caps |=
365  * GeodesicLine::AREA.
366  *
367  * The values of \e lon2 and \e azi2 returned are in the range
368  * [&minus;180&deg;, 180&deg;).
369  *
370  * Requesting a value which the GeodesicLine object is not capable of
371  * computing is not an error; the corresponding argument will not be
372  * altered.
373  *
374  * The following functions are overloaded versions of
375  * GeodesicLine::ArcPosition which omit some of the output parameters.
376  **********************************************************************/
377  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
378  real& s12, real& m12, real& M12, real& M21,
379  real& S12) const {
380  GenPosition(true, a12,
381  LATITUDE | LONGITUDE | AZIMUTH | DISTANCE |
382  REDUCEDLENGTH | GEODESICSCALE | AREA,
383  lat2, lon2, azi2, s12, m12, M12, M21, S12);
384  }
385 
386  /**
387  * See the documentation for GeodesicLine::ArcPosition.
388  **********************************************************************/
389  void ArcPosition(real a12, real& lat2, real& lon2)
390  const {
391  real t;
392  GenPosition(true, a12,
393  LATITUDE | LONGITUDE,
394  lat2, lon2, t, t, t, t, t, t);
395  }
396 
397  /**
398  * See the documentation for GeodesicLine::ArcPosition.
399  **********************************************************************/
400  void ArcPosition(real a12,
401  real& lat2, real& lon2, real& azi2)
402  const {
403  real t;
404  GenPosition(true, a12,
405  LATITUDE | LONGITUDE | AZIMUTH,
406  lat2, lon2, azi2, t, t, t, t, t);
407  }
408 
409  /**
410  * See the documentation for GeodesicLine::ArcPosition.
411  **********************************************************************/
412  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
413  real& s12) const {
414  real t;
415  GenPosition(true, a12,
416  LATITUDE | LONGITUDE | AZIMUTH | DISTANCE,
417  lat2, lon2, azi2, s12, t, t, t, t);
418  }
419 
420  /**
421  * See the documentation for GeodesicLine::ArcPosition.
422  **********************************************************************/
423  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
424  real& s12, real& m12) const {
425  real t;
426  GenPosition(true, a12,
427  LATITUDE | LONGITUDE | AZIMUTH |
428  DISTANCE | REDUCEDLENGTH,
429  lat2, lon2, azi2, s12, m12, t, t, t);
430  }
431 
432  /**
433  * See the documentation for GeodesicLine::ArcPosition.
434  **********************************************************************/
435  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
436  real& s12, real& M12, real& M21)
437  const {
438  real t;
439  GenPosition(true, a12,
440  LATITUDE | LONGITUDE | AZIMUTH |
441  DISTANCE | GEODESICSCALE,
442  lat2, lon2, azi2, s12, t, M12, M21, t);
443  }
444 
445  /**
446  * See the documentation for GeodesicLine::ArcPosition.
447  **********************************************************************/
448  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
449  real& s12, real& m12, real& M12, real& M21)
450  const {
451  real t;
452  GenPosition(true, a12,
453  LATITUDE | LONGITUDE | AZIMUTH |
454  DISTANCE | REDUCEDLENGTH | GEODESICSCALE,
455  lat2, lon2, azi2, s12, m12, M12, M21, t);
456  }
457  ///@}
458 
459  /** \name The general position function.
460  **********************************************************************/
461  ///@{
462 
463  /**
464  * The general position function. GeodesicLine::Position and
465  * GeodesicLine::ArcPosition are defined in terms of this function.
466  *
467  * @param[in] arcmode boolean flag determining the meaning of the second
468  * parameter; if arcmode is false, then the GeodesicLine object must have
469  * been constructed with \e caps |= GeodesicLine::DISTANCE_IN.
470  * @param[in] s12_a12 if \e arcmode is false, this is the distance between
471  * point 1 and point 2 (meters); otherwise it is the arc length between
472  * point 1 and point 2 (degrees); it can be negative.
473  * @param[in] outmask a bitor'ed combination of GeodesicLine::mask values
474  * specifying which of the following parameters should be set.
475  * @param[out] lat2 latitude of point 2 (degrees).
476  * @param[out] lon2 longitude of point 2 (degrees); requires that the
477  * GeodesicLine object was constructed with \e caps |=
478  * GeodesicLine::LONGITUDE.
479  * @param[out] azi2 (forward) azimuth at point 2 (degrees).
480  * @param[out] s12 distance between point 1 and point 2 (meters); requires
481  * that the GeodesicLine object was constructed with \e caps |=
482  * GeodesicLine::DISTANCE.
483  * @param[out] m12 reduced length of geodesic (meters); requires that the
484  * GeodesicLine object was constructed with \e caps |=
485  * GeodesicLine::REDUCEDLENGTH.
486  * @param[out] M12 geodesic scale of point 2 relative to point 1
487  * (dimensionless); requires that the GeodesicLine object was constructed
488  * with \e caps |= GeodesicLine::GEODESICSCALE.
489  * @param[out] M21 geodesic scale of point 1 relative to point 2
490  * (dimensionless); requires that the GeodesicLine object was constructed
491  * with \e caps |= GeodesicLine::GEODESICSCALE.
492  * @param[out] S12 area under the geodesic (meters<sup>2</sup>); requires
493  * that the GeodesicLine object was constructed with \e caps |=
494  * GeodesicLine::AREA.
495  * @return \e a12 arc length of between point 1 and point 2 (degrees).
496  *
497  * The GeodesicLine::mask values possible for \e outmask are
498  * - \e outmask |= GeodesicLine::LATITUDE for the latitude \e lat2;
499  * - \e outmask |= GeodesicLine::LONGITUDE for the latitude \e lon2;
500  * - \e outmask |= GeodesicLine::AZIMUTH for the latitude \e azi2;
501  * - \e outmask |= GeodesicLine::DISTANCE for the distance \e s12;
502  * - \e outmask |= GeodesicLine::REDUCEDLENGTH for the reduced length \e
503  * m12;
504  * - \e outmask |= GeodesicLine::GEODESICSCALE for the geodesic scales \e
505  * M12 and \e M21;
506  * - \e outmask |= GeodesicLine::AREA for the area \e S12;
507  * - \e outmask |= GeodesicLine::ALL for all of the above;
508  * - \e outmask |= GeodesicLine::LONG_UNROLL to unroll \e lon2 instead of
509  * reducing it into the range [&minus;180&deg;, 180&deg;).
510  * .
511  * Requesting a value which the GeodesicLine object is not capable of
512  * computing is not an error; the corresponding argument will not be
513  * altered. Note, however, that the arc length is always computed and
514  * returned as the function value.
515  *
516  * With the GeodesicLine::LONG_UNROLL bit set, the quantity \e lon2 &minus;
517  * \e lon1 indicates how many times and in what sense the geodesic
518  * encircles the ellipsoid.
519  **********************************************************************/
520  Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask,
521  real& lat2, real& lon2, real& azi2,
522  real& s12, real& m12, real& M12, real& M21,
523  real& S12) const;
524 
525  ///@}
526 
527  /** \name Inspector functions
528  **********************************************************************/
529  ///@{
530 
531  /**
532  * @return true if the object has been initialized.
533  **********************************************************************/
534  bool Init() const { return _caps != 0U; }
535 
536  /**
537  * @return \e lat1 the latitude of point 1 (degrees).
538  **********************************************************************/
540  { return Init() ? _lat1 : Math::NaN(); }
541 
542  /**
543  * @return \e lon1 the longitude of point 1 (degrees).
544  **********************************************************************/
546  { return Init() ? _lon1 : Math::NaN(); }
547 
548  /**
549  * @return \e azi1 the azimuth (degrees) of the geodesic line at point 1.
550  **********************************************************************/
552  { return Init() ? _azi1 : Math::NaN(); }
553 
554  /**
555  * @return \e azi0 the azimuth (degrees) of the geodesic line as it crosses
556  * the equator in a northward direction.
557  *
558  * The result lies in [&minus;90&deg;, 90&deg;].
559  **********************************************************************/
561  return Init() ? Math::atan2d(_salp0, _calp0) : Math::NaN();
562  }
563 
564  /**
565  * @return \e a1 the arc length (degrees) between the northward equatorial
566  * crossing and point 1.
567  *
568  * The result lies in (&minus;180&deg;, 180&deg;].
569  **********************************************************************/
571  return Init() ? Math::atan2d(_ssig1, _csig1) : Math::NaN();
572  }
573 
574  /**
575  * @return \e a the equatorial radius of the ellipsoid (meters). This is
576  * the value inherited from the Geodesic object used in the constructor.
577  **********************************************************************/
579  { return Init() ? _a : Math::NaN(); }
580 
581  /**
582  * @return \e f the flattening of the ellipsoid. This is the value
583  * inherited from the Geodesic object used in the constructor.
584  **********************************************************************/
586  { return Init() ? _f : Math::NaN(); }
587 
588  /// \cond SKIP
589  /**
590  * <b>DEPRECATED</b>
591  * @return \e r the inverse flattening of the ellipsoid.
592  **********************************************************************/
593  Math::real InverseFlattening() const
594  { return Init() ? 1/_f : Math::NaN(); }
595  /// \endcond
596 
597  /**
598  * @return \e caps the computational capabilities that this object was
599  * constructed with. LATITUDE and AZIMUTH are always included.
600  **********************************************************************/
601  unsigned Capabilities() const { return _caps; }
602 
603  /**
604  * @param[in] testcaps a set of bitor'ed GeodesicLine::mask values.
605  * @return true if the GeodesicLine object has all these capabilities.
606  **********************************************************************/
607  bool Capabilities(unsigned testcaps) const {
608  testcaps &= OUT_ALL;
609  return (_caps & testcaps) == testcaps;
610  }
611  ///@}
612 
613  };
614 
615 } // namespace GeographicLib
616 
617 #endif // GEOGRAPHICLIB_GEODESICLINE_HPP
Math::real Position(real s12, real &lat2, real &lon2, real &azi2) const
static T NaN()
Definition: Math.hpp:783
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
static T atan2d(T y, T x)
Definition: Math.hpp:676
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
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