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