Geodesic.hpp 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977
  1. /**
  2. * \file Geodesic.hpp
  3. * \brief Header for GeographicLib::Geodesic class
  4. *
  5. * Copyright (c) Charles Karney (2009-2020) <charles@karney.com> and licensed
  6. * under the MIT/X11 License. For more information, see
  7. * https://geographiclib.sourceforge.io/
  8. **********************************************************************/
  9. #if !defined(GEOGRAPHICLIB_GEODESIC_HPP)
  10. #define GEOGRAPHICLIB_GEODESIC_HPP 1
  11. #include <GeographicLib/Constants.hpp>
  12. #if !defined(GEOGRAPHICLIB_GEODESIC_ORDER)
  13. /**
  14. * The order of the expansions used by Geodesic.
  15. * GEOGRAPHICLIB_GEODESIC_ORDER can be set to any integer in [3, 8].
  16. **********************************************************************/
  17. # define GEOGRAPHICLIB_GEODESIC_ORDER \
  18. (GEOGRAPHICLIB_PRECISION == 2 ? 6 : \
  19. (GEOGRAPHICLIB_PRECISION == 1 ? 3 : \
  20. (GEOGRAPHICLIB_PRECISION == 3 ? 7 : 8)))
  21. #endif
  22. namespace GeographicLib {
  23. class GeodesicLine;
  24. /**
  25. * \brief %Geodesic calculations
  26. *
  27. * The shortest path between two points on a ellipsoid at (\e lat1, \e lon1)
  28. * and (\e lat2, \e lon2) is called the geodesic. Its length is \e s12 and
  29. * the geodesic from point 1 to point 2 has azimuths \e azi1 and \e azi2 at
  30. * the two end points. (The azimuth is the heading measured clockwise from
  31. * north. \e azi2 is the "forward" azimuth, i.e., the heading that takes you
  32. * beyond point 2 not back to point 1.) In the figure below, latitude if
  33. * labeled &phi;, longitude &lambda; (with &lambda;<sub>12</sub> =
  34. * &lambda;<sub>2</sub> &minus; &lambda;<sub>1</sub>), and azimuth &alpha;.
  35. *
  36. * <img src="https://upload.wikimedia.org/wikipedia/commons/c/cb/Geodesic_problem_on_an_ellipsoid.svg" width=250 alt="spheroidal triangle">
  37. *
  38. * Given \e lat1, \e lon1, \e azi1, and \e s12, we can determine \e lat2, \e
  39. * lon2, and \e azi2. This is the \e direct geodesic problem and its
  40. * solution is given by the function Geodesic::Direct. (If \e s12 is
  41. * sufficiently large that the geodesic wraps more than halfway around the
  42. * earth, there will be another geodesic between the points with a smaller \e
  43. * s12.)
  44. *
  45. * Given \e lat1, \e lon1, \e lat2, and \e lon2, we can determine \e azi1, \e
  46. * azi2, and \e s12. This is the \e inverse geodesic problem, whose solution
  47. * is given by Geodesic::Inverse. Usually, the solution to the inverse
  48. * problem is unique. In cases where there are multiple solutions (all with
  49. * the same \e s12, of course), all the solutions can be easily generated
  50. * once a particular solution is provided.
  51. *
  52. * The standard way of specifying the direct problem is the specify the
  53. * distance \e s12 to the second point. However it is sometimes useful
  54. * instead to specify the arc length \e a12 (in degrees) on the auxiliary
  55. * sphere. This is a mathematical construct used in solving the geodesic
  56. * problems. The solution of the direct problem in this form is provided by
  57. * Geodesic::ArcDirect. An arc length in excess of 180&deg; indicates that
  58. * the geodesic is not a shortest path. In addition, the arc length between
  59. * an equatorial crossing and the next extremum of latitude for a geodesic is
  60. * 90&deg;.
  61. *
  62. * This class can also calculate several other quantities related to
  63. * geodesics. These are:
  64. * - <i>reduced length</i>. If we fix the first point and increase \e azi1
  65. * by \e dazi1 (radians), the second point is displaced \e m12 \e dazi1 in
  66. * the direction \e azi2 + 90&deg;. The quantity \e m12 is called
  67. * the "reduced length" and is symmetric under interchange of the two
  68. * points. On a curved surface the reduced length obeys a symmetry
  69. * relation, \e m12 + \e m21 = 0. On a flat surface, we have \e m12 = \e
  70. * s12. The ratio <i>s12</i>/\e m12 gives the azimuthal scale for an
  71. * azimuthal equidistant projection.
  72. * - <i>geodesic scale</i>. Consider a reference geodesic and a second
  73. * geodesic parallel to this one at point 1 and separated by a small
  74. * distance \e dt. The separation of the two geodesics at point 2 is \e
  75. * M12 \e dt where \e M12 is called the "geodesic scale". \e M21 is
  76. * defined similarly (with the geodesics being parallel at point 2). On a
  77. * flat surface, we have \e M12 = \e M21 = 1. The quantity 1/\e M12 gives
  78. * the scale of the Cassini-Soldner projection.
  79. * - <i>area</i>. The area between the geodesic from point 1 to point 2 and
  80. * the equation is represented by \e S12; it is the area, measured
  81. * counter-clockwise, of the geodesic quadrilateral with corners
  82. * (<i>lat1</i>,<i>lon1</i>), (0,<i>lon1</i>), (0,<i>lon2</i>), and
  83. * (<i>lat2</i>,<i>lon2</i>). It can be used to compute the area of any
  84. * geodesic polygon.
  85. *
  86. * Overloaded versions of Geodesic::Direct, Geodesic::ArcDirect, and
  87. * Geodesic::Inverse allow these quantities to be returned. In addition
  88. * there are general functions Geodesic::GenDirect, and Geodesic::GenInverse
  89. * which allow an arbitrary set of results to be computed. The quantities \e
  90. * m12, \e M12, \e M21 which all specify the behavior of nearby geodesics
  91. * obey addition rules. If points 1, 2, and 3 all lie on a single geodesic,
  92. * then the following rules hold:
  93. * - \e s13 = \e s12 + \e s23
  94. * - \e a13 = \e a12 + \e a23
  95. * - \e S13 = \e S12 + \e S23
  96. * - \e m13 = \e m12 \e M23 + \e m23 \e M21
  97. * - \e M13 = \e M12 \e M23 &minus; (1 &minus; \e M12 \e M21) \e m23 / \e m12
  98. * - \e M31 = \e M32 \e M21 &minus; (1 &minus; \e M23 \e M32) \e m12 / \e m23
  99. *
  100. * Additional functionality is provided by the GeodesicLine class, which
  101. * allows a sequence of points along a geodesic to be computed.
  102. *
  103. * The shortest distance returned by the solution of the inverse problem is
  104. * (obviously) uniquely defined. However, in a few special cases there are
  105. * multiple azimuths which yield the same shortest distance. Here is a
  106. * catalog of those cases:
  107. * - \e lat1 = &minus;\e lat2 (with neither point at a pole). If \e azi1 =
  108. * \e azi2, the geodesic is unique. Otherwise there are two geodesics and
  109. * the second one is obtained by setting [\e azi1, \e azi2] &rarr; [\e
  110. * azi2, \e azi1], [\e M12, \e M21] &rarr; [\e M21, \e M12], \e S12 &rarr;
  111. * &minus;\e S12. (This occurs when the longitude difference is near
  112. * &plusmn;180&deg; for oblate ellipsoids.)
  113. * - \e lon2 = \e lon1 &plusmn; 180&deg; (with neither point at a pole). If
  114. * \e azi1 = 0&deg; or &plusmn;180&deg;, the geodesic is unique. Otherwise
  115. * there are two geodesics and the second one is obtained by setting [\e
  116. * azi1, \e azi2] &rarr; [&minus;\e azi1, &minus;\e azi2], \e S12 &rarr;
  117. * &minus;\e S12. (This occurs when \e lat2 is near &minus;\e lat1 for
  118. * prolate ellipsoids.)
  119. * - Points 1 and 2 at opposite poles. There are infinitely many geodesics
  120. * which can be generated by setting [\e azi1, \e azi2] &rarr; [\e azi1, \e
  121. * azi2] + [\e d, &minus;\e d], for arbitrary \e d. (For spheres, this
  122. * prescription applies when points 1 and 2 are antipodal.)
  123. * - \e s12 = 0 (coincident points). There are infinitely many geodesics
  124. * which can be generated by setting [\e azi1, \e azi2] &rarr;
  125. * [\e azi1, \e azi2] + [\e d, \e d], for arbitrary \e d.
  126. *
  127. * The calculations are accurate to better than 15 nm (15 nanometers) for the
  128. * WGS84 ellipsoid. See Sec. 9 of
  129. * <a href="https://arxiv.org/abs/1102.1215v1">arXiv:1102.1215v1</a> for
  130. * details. The algorithms used by this class are based on series expansions
  131. * using the flattening \e f as a small parameter. These are only accurate
  132. * for |<i>f</i>| &lt; 0.02; however reasonably accurate results will be
  133. * obtained for |<i>f</i>| &lt; 0.2. Here is a table of the approximate
  134. * maximum error (expressed as a distance) for an ellipsoid with the same
  135. * equatorial radius as the WGS84 ellipsoid and different values of the
  136. * flattening.<pre>
  137. * |f| error
  138. * 0.01 25 nm
  139. * 0.02 30 nm
  140. * 0.05 10 um
  141. * 0.1 1.5 mm
  142. * 0.2 300 mm
  143. * </pre>
  144. * For very eccentric ellipsoids, use GeodesicExact instead.
  145. *
  146. * The algorithms are described in
  147. * - C. F. F. Karney,
  148. * <a href="https://doi.org/10.1007/s00190-012-0578-z">
  149. * Algorithms for geodesics</a>,
  150. * J. Geodesy <b>87</b>, 43--55 (2013);
  151. * DOI: <a href="https://doi.org/10.1007/s00190-012-0578-z">
  152. * 10.1007/s00190-012-0578-z</a>;
  153. * addenda:
  154. * <a href="https://geographiclib.sourceforge.io/geod-addenda.html">
  155. * geod-addenda.html</a>.
  156. * .
  157. * For more information on geodesics see \ref geodesic.
  158. *
  159. * Example of use:
  160. * \include example-Geodesic.cpp
  161. *
  162. * <a href="GeodSolve.1.html">GeodSolve</a> is a command-line utility
  163. * providing access to the functionality of Geodesic and GeodesicLine.
  164. **********************************************************************/
  165. class GEOGRAPHICLIB_EXPORT Geodesic {
  166. private:
  167. typedef Math::real real;
  168. friend class GeodesicLine;
  169. static const int nA1_ = GEOGRAPHICLIB_GEODESIC_ORDER;
  170. static const int nC1_ = GEOGRAPHICLIB_GEODESIC_ORDER;
  171. static const int nC1p_ = GEOGRAPHICLIB_GEODESIC_ORDER;
  172. static const int nA2_ = GEOGRAPHICLIB_GEODESIC_ORDER;
  173. static const int nC2_ = GEOGRAPHICLIB_GEODESIC_ORDER;
  174. static const int nA3_ = GEOGRAPHICLIB_GEODESIC_ORDER;
  175. static const int nA3x_ = nA3_;
  176. static const int nC3_ = GEOGRAPHICLIB_GEODESIC_ORDER;
  177. static const int nC3x_ = (nC3_ * (nC3_ - 1)) / 2;
  178. static const int nC4_ = GEOGRAPHICLIB_GEODESIC_ORDER;
  179. static const int nC4x_ = (nC4_ * (nC4_ + 1)) / 2;
  180. // Size for temporary array
  181. // nC = max(max(nC1_, nC1p_, nC2_) + 1, max(nC3_, nC4_))
  182. static const int nC_ = GEOGRAPHICLIB_GEODESIC_ORDER + 1;
  183. static const unsigned maxit1_ = 20;
  184. unsigned maxit2_;
  185. real tiny_, tol0_, tol1_, tol2_, tolb_, xthresh_;
  186. enum captype {
  187. CAP_NONE = 0U,
  188. CAP_C1 = 1U<<0,
  189. CAP_C1p = 1U<<1,
  190. CAP_C2 = 1U<<2,
  191. CAP_C3 = 1U<<3,
  192. CAP_C4 = 1U<<4,
  193. CAP_ALL = 0x1FU,
  194. CAP_MASK = CAP_ALL,
  195. OUT_ALL = 0x7F80U,
  196. OUT_MASK = 0xFF80U, // Includes LONG_UNROLL
  197. };
  198. static real SinCosSeries(bool sinp,
  199. real sinx, real cosx, const real c[], int n);
  200. static real Astroid(real x, real y);
  201. real _a, _f, _f1, _e2, _ep2, _n, _b, _c2, _etol2;
  202. real _A3x[nA3x_], _C3x[nC3x_], _C4x[nC4x_];
  203. void Lengths(real eps, real sig12,
  204. real ssig1, real csig1, real dn1,
  205. real ssig2, real csig2, real dn2,
  206. real cbet1, real cbet2, unsigned outmask,
  207. real& s12s, real& m12a, real& m0,
  208. real& M12, real& M21, real Ca[]) const;
  209. real InverseStart(real sbet1, real cbet1, real dn1,
  210. real sbet2, real cbet2, real dn2,
  211. real lam12, real slam12, real clam12,
  212. real& salp1, real& calp1,
  213. real& salp2, real& calp2, real& dnm,
  214. real Ca[]) const;
  215. real Lambda12(real sbet1, real cbet1, real dn1,
  216. real sbet2, real cbet2, real dn2,
  217. real salp1, real calp1, real slam120, real clam120,
  218. real& salp2, real& calp2, real& sig12,
  219. real& ssig1, real& csig1, real& ssig2, real& csig2,
  220. real& eps, real& domg12,
  221. bool diffp, real& dlam12, real Ca[]) const;
  222. real GenInverse(real lat1, real lon1, real lat2, real lon2,
  223. unsigned outmask, real& s12,
  224. real& salp1, real& calp1, real& salp2, real& calp2,
  225. real& m12, real& M12, real& M21, real& S12) const;
  226. // These are Maxima generated functions to provide series approximations to
  227. // the integrals for the ellipsoidal geodesic.
  228. static real A1m1f(real eps);
  229. static void C1f(real eps, real c[]);
  230. static void C1pf(real eps, real c[]);
  231. static real A2m1f(real eps);
  232. static void C2f(real eps, real c[]);
  233. void A3coeff();
  234. real A3f(real eps) const;
  235. void C3coeff();
  236. void C3f(real eps, real c[]) const;
  237. void C4coeff();
  238. void C4f(real k2, real c[]) const;
  239. public:
  240. /**
  241. * Bit masks for what calculations to do. These masks do double duty.
  242. * They signify to the GeodesicLine::GeodesicLine constructor and to
  243. * Geodesic::Line what capabilities should be included in the GeodesicLine
  244. * object. They also specify which results to return in the general
  245. * routines Geodesic::GenDirect and Geodesic::GenInverse routines.
  246. * GeodesicLine::mask is a duplication of this enum.
  247. **********************************************************************/
  248. enum mask {
  249. /**
  250. * No capabilities, no output.
  251. * @hideinitializer
  252. **********************************************************************/
  253. NONE = 0U,
  254. /**
  255. * Calculate latitude \e lat2. (It's not necessary to include this as a
  256. * capability to GeodesicLine because this is included by default.)
  257. * @hideinitializer
  258. **********************************************************************/
  259. LATITUDE = 1U<<7 | CAP_NONE,
  260. /**
  261. * Calculate longitude \e lon2.
  262. * @hideinitializer
  263. **********************************************************************/
  264. LONGITUDE = 1U<<8 | CAP_C3,
  265. /**
  266. * Calculate azimuths \e azi1 and \e azi2. (It's not necessary to
  267. * include this as a capability to GeodesicLine because this is included
  268. * by default.)
  269. * @hideinitializer
  270. **********************************************************************/
  271. AZIMUTH = 1U<<9 | CAP_NONE,
  272. /**
  273. * Calculate distance \e s12.
  274. * @hideinitializer
  275. **********************************************************************/
  276. DISTANCE = 1U<<10 | CAP_C1,
  277. /**
  278. * Allow distance \e s12 to be used as input in the direct geodesic
  279. * problem.
  280. * @hideinitializer
  281. **********************************************************************/
  282. DISTANCE_IN = 1U<<11 | CAP_C1 | CAP_C1p,
  283. /**
  284. * Calculate reduced length \e m12.
  285. * @hideinitializer
  286. **********************************************************************/
  287. REDUCEDLENGTH = 1U<<12 | CAP_C1 | CAP_C2,
  288. /**
  289. * Calculate geodesic scales \e M12 and \e M21.
  290. * @hideinitializer
  291. **********************************************************************/
  292. GEODESICSCALE = 1U<<13 | CAP_C1 | CAP_C2,
  293. /**
  294. * Calculate area \e S12.
  295. * @hideinitializer
  296. **********************************************************************/
  297. AREA = 1U<<14 | CAP_C4,
  298. /**
  299. * Unroll \e lon2 in the direct calculation.
  300. * @hideinitializer
  301. **********************************************************************/
  302. LONG_UNROLL = 1U<<15,
  303. /**
  304. * All capabilities, calculate everything. (LONG_UNROLL is not
  305. * included in this mask.)
  306. * @hideinitializer
  307. **********************************************************************/
  308. ALL = OUT_ALL| CAP_ALL,
  309. };
  310. /** \name Constructor
  311. **********************************************************************/
  312. ///@{
  313. /**
  314. * Constructor for a ellipsoid with
  315. *
  316. * @param[in] a equatorial radius (meters).
  317. * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere.
  318. * Negative \e f gives a prolate ellipsoid.
  319. * @exception GeographicErr if \e a or (1 &minus; \e f) \e a is not
  320. * positive.
  321. **********************************************************************/
  322. Geodesic(real a, real f);
  323. ///@}
  324. /** \name Direct geodesic problem specified in terms of distance.
  325. **********************************************************************/
  326. ///@{
  327. /**
  328. * Solve the direct geodesic problem where the length of the geodesic
  329. * is specified in terms of distance.
  330. *
  331. * @param[in] lat1 latitude of point 1 (degrees).
  332. * @param[in] lon1 longitude of point 1 (degrees).
  333. * @param[in] azi1 azimuth at point 1 (degrees).
  334. * @param[in] s12 distance between point 1 and point 2 (meters); it can be
  335. * negative.
  336. * @param[out] lat2 latitude of point 2 (degrees).
  337. * @param[out] lon2 longitude of point 2 (degrees).
  338. * @param[out] azi2 (forward) azimuth at point 2 (degrees).
  339. * @param[out] m12 reduced length of geodesic (meters).
  340. * @param[out] M12 geodesic scale of point 2 relative to point 1
  341. * (dimensionless).
  342. * @param[out] M21 geodesic scale of point 1 relative to point 2
  343. * (dimensionless).
  344. * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
  345. * @return \e a12 arc length of between point 1 and point 2 (degrees).
  346. *
  347. * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]. The values of
  348. * \e lon2 and \e azi2 returned are in the range [&minus;180&deg;,
  349. * 180&deg;].
  350. *
  351. * If either point is at a pole, the azimuth is defined by keeping the
  352. * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;),
  353. * and taking the limit &epsilon; &rarr; 0+. An arc length greater that
  354. * 180&deg; signifies a geodesic which is not a shortest path. (For a
  355. * prolate ellipsoid, an additional condition is necessary for a shortest
  356. * path: the longitudinal extent must not exceed of 180&deg;.)
  357. *
  358. * The following functions are overloaded versions of Geodesic::Direct
  359. * which omit some of the output parameters. Note, however, that the arc
  360. * length is always computed and returned as the function value.
  361. **********************************************************************/
  362. Math::real Direct(real lat1, real lon1, real azi1, real s12,
  363. real& lat2, real& lon2, real& azi2,
  364. real& m12, real& M12, real& M21, real& S12)
  365. const {
  366. real t;
  367. return GenDirect(lat1, lon1, azi1, false, s12,
  368. LATITUDE | LONGITUDE | AZIMUTH |
  369. REDUCEDLENGTH | GEODESICSCALE | AREA,
  370. lat2, lon2, azi2, t, m12, M12, M21, S12);
  371. }
  372. /**
  373. * See the documentation for Geodesic::Direct.
  374. **********************************************************************/
  375. Math::real Direct(real lat1, real lon1, real azi1, real s12,
  376. real& lat2, real& lon2)
  377. const {
  378. real t;
  379. return GenDirect(lat1, lon1, azi1, false, s12,
  380. LATITUDE | LONGITUDE,
  381. lat2, lon2, t, t, t, t, t, t);
  382. }
  383. /**
  384. * See the documentation for Geodesic::Direct.
  385. **********************************************************************/
  386. Math::real Direct(real lat1, real lon1, real azi1, real s12,
  387. real& lat2, real& lon2, real& azi2)
  388. const {
  389. real t;
  390. return GenDirect(lat1, lon1, azi1, false, s12,
  391. LATITUDE | LONGITUDE | AZIMUTH,
  392. lat2, lon2, azi2, t, t, t, t, t);
  393. }
  394. /**
  395. * See the documentation for Geodesic::Direct.
  396. **********************************************************************/
  397. Math::real Direct(real lat1, real lon1, real azi1, real s12,
  398. real& lat2, real& lon2, real& azi2, real& m12)
  399. const {
  400. real t;
  401. return GenDirect(lat1, lon1, azi1, false, s12,
  402. LATITUDE | LONGITUDE | AZIMUTH | REDUCEDLENGTH,
  403. lat2, lon2, azi2, t, m12, t, t, t);
  404. }
  405. /**
  406. * See the documentation for Geodesic::Direct.
  407. **********************************************************************/
  408. Math::real Direct(real lat1, real lon1, real azi1, real s12,
  409. real& lat2, real& lon2, real& azi2,
  410. real& M12, real& M21)
  411. const {
  412. real t;
  413. return GenDirect(lat1, lon1, azi1, false, s12,
  414. LATITUDE | LONGITUDE | AZIMUTH | GEODESICSCALE,
  415. lat2, lon2, azi2, t, t, M12, M21, t);
  416. }
  417. /**
  418. * See the documentation for Geodesic::Direct.
  419. **********************************************************************/
  420. Math::real Direct(real lat1, real lon1, real azi1, real s12,
  421. real& lat2, real& lon2, real& azi2,
  422. real& m12, real& M12, real& M21)
  423. const {
  424. real t;
  425. return GenDirect(lat1, lon1, azi1, false, s12,
  426. LATITUDE | LONGITUDE | AZIMUTH |
  427. REDUCEDLENGTH | GEODESICSCALE,
  428. lat2, lon2, azi2, t, m12, M12, M21, t);
  429. }
  430. ///@}
  431. /** \name Direct geodesic problem specified in terms of arc length.
  432. **********************************************************************/
  433. ///@{
  434. /**
  435. * Solve the direct geodesic problem where the length of the geodesic
  436. * is specified in terms of arc length.
  437. *
  438. * @param[in] lat1 latitude of point 1 (degrees).
  439. * @param[in] lon1 longitude of point 1 (degrees).
  440. * @param[in] azi1 azimuth at point 1 (degrees).
  441. * @param[in] a12 arc length between point 1 and point 2 (degrees); it can
  442. * be negative.
  443. * @param[out] lat2 latitude of point 2 (degrees).
  444. * @param[out] lon2 longitude of point 2 (degrees).
  445. * @param[out] azi2 (forward) azimuth at point 2 (degrees).
  446. * @param[out] s12 distance between point 1 and point 2 (meters).
  447. * @param[out] m12 reduced length of geodesic (meters).
  448. * @param[out] M12 geodesic scale of point 2 relative to point 1
  449. * (dimensionless).
  450. * @param[out] M21 geodesic scale of point 1 relative to point 2
  451. * (dimensionless).
  452. * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
  453. *
  454. * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]. The values of
  455. * \e lon2 and \e azi2 returned are in the range [&minus;180&deg;,
  456. * 180&deg;].
  457. *
  458. * If either point is at a pole, the azimuth is defined by keeping the
  459. * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;),
  460. * and taking the limit &epsilon; &rarr; 0+. An arc length greater that
  461. * 180&deg; signifies a geodesic which is not a shortest path. (For a
  462. * prolate ellipsoid, an additional condition is necessary for a shortest
  463. * path: the longitudinal extent must not exceed of 180&deg;.)
  464. *
  465. * The following functions are overloaded versions of Geodesic::Direct
  466. * which omit some of the output parameters.
  467. **********************************************************************/
  468. void ArcDirect(real lat1, real lon1, real azi1, real a12,
  469. real& lat2, real& lon2, real& azi2, real& s12,
  470. real& m12, real& M12, real& M21, real& S12)
  471. const {
  472. GenDirect(lat1, lon1, azi1, true, a12,
  473. LATITUDE | LONGITUDE | AZIMUTH | DISTANCE |
  474. REDUCEDLENGTH | GEODESICSCALE | AREA,
  475. lat2, lon2, azi2, s12, m12, M12, M21, S12);
  476. }
  477. /**
  478. * See the documentation for Geodesic::ArcDirect.
  479. **********************************************************************/
  480. void ArcDirect(real lat1, real lon1, real azi1, real a12,
  481. real& lat2, real& lon2) const {
  482. real t;
  483. GenDirect(lat1, lon1, azi1, true, a12,
  484. LATITUDE | LONGITUDE,
  485. lat2, lon2, t, t, t, t, t, t);
  486. }
  487. /**
  488. * See the documentation for Geodesic::ArcDirect.
  489. **********************************************************************/
  490. void ArcDirect(real lat1, real lon1, real azi1, real a12,
  491. real& lat2, real& lon2, real& azi2) const {
  492. real t;
  493. GenDirect(lat1, lon1, azi1, true, a12,
  494. LATITUDE | LONGITUDE | AZIMUTH,
  495. lat2, lon2, azi2, t, t, t, t, t);
  496. }
  497. /**
  498. * See the documentation for Geodesic::ArcDirect.
  499. **********************************************************************/
  500. void ArcDirect(real lat1, real lon1, real azi1, real a12,
  501. real& lat2, real& lon2, real& azi2, real& s12)
  502. const {
  503. real t;
  504. GenDirect(lat1, lon1, azi1, true, a12,
  505. LATITUDE | LONGITUDE | AZIMUTH | DISTANCE,
  506. lat2, lon2, azi2, s12, t, t, t, t);
  507. }
  508. /**
  509. * See the documentation for Geodesic::ArcDirect.
  510. **********************************************************************/
  511. void ArcDirect(real lat1, real lon1, real azi1, real a12,
  512. real& lat2, real& lon2, real& azi2,
  513. real& s12, real& m12) const {
  514. real t;
  515. GenDirect(lat1, lon1, azi1, true, a12,
  516. LATITUDE | LONGITUDE | AZIMUTH | DISTANCE |
  517. REDUCEDLENGTH,
  518. lat2, lon2, azi2, s12, m12, t, t, t);
  519. }
  520. /**
  521. * See the documentation for Geodesic::ArcDirect.
  522. **********************************************************************/
  523. void ArcDirect(real lat1, real lon1, real azi1, real a12,
  524. real& lat2, real& lon2, real& azi2, real& s12,
  525. real& M12, real& M21) const {
  526. real t;
  527. GenDirect(lat1, lon1, azi1, true, a12,
  528. LATITUDE | LONGITUDE | AZIMUTH | DISTANCE |
  529. GEODESICSCALE,
  530. lat2, lon2, azi2, s12, t, M12, M21, t);
  531. }
  532. /**
  533. * See the documentation for Geodesic::ArcDirect.
  534. **********************************************************************/
  535. void ArcDirect(real lat1, real lon1, real azi1, real a12,
  536. real& lat2, real& lon2, real& azi2, real& s12,
  537. real& m12, real& M12, real& M21) const {
  538. real t;
  539. GenDirect(lat1, lon1, azi1, true, a12,
  540. LATITUDE | LONGITUDE | AZIMUTH | DISTANCE |
  541. REDUCEDLENGTH | GEODESICSCALE,
  542. lat2, lon2, azi2, s12, m12, M12, M21, t);
  543. }
  544. ///@}
  545. /** \name General version of the direct geodesic solution.
  546. **********************************************************************/
  547. ///@{
  548. /**
  549. * The general direct geodesic problem. Geodesic::Direct and
  550. * Geodesic::ArcDirect are defined in terms of this function.
  551. *
  552. * @param[in] lat1 latitude of point 1 (degrees).
  553. * @param[in] lon1 longitude of point 1 (degrees).
  554. * @param[in] azi1 azimuth at point 1 (degrees).
  555. * @param[in] arcmode boolean flag determining the meaning of the \e
  556. * s12_a12.
  557. * @param[in] s12_a12 if \e arcmode is false, this is the distance between
  558. * point 1 and point 2 (meters); otherwise it is the arc length between
  559. * point 1 and point 2 (degrees); it can be negative.
  560. * @param[in] outmask a bitor'ed combination of Geodesic::mask values
  561. * specifying which of the following parameters should be set.
  562. * @param[out] lat2 latitude of point 2 (degrees).
  563. * @param[out] lon2 longitude of point 2 (degrees).
  564. * @param[out] azi2 (forward) azimuth at point 2 (degrees).
  565. * @param[out] s12 distance between point 1 and point 2 (meters).
  566. * @param[out] m12 reduced length of geodesic (meters).
  567. * @param[out] M12 geodesic scale of point 2 relative to point 1
  568. * (dimensionless).
  569. * @param[out] M21 geodesic scale of point 1 relative to point 2
  570. * (dimensionless).
  571. * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
  572. * @return \e a12 arc length of between point 1 and point 2 (degrees).
  573. *
  574. * The Geodesic::mask values possible for \e outmask are
  575. * - \e outmask |= Geodesic::LATITUDE for the latitude \e lat2;
  576. * - \e outmask |= Geodesic::LONGITUDE for the latitude \e lon2;
  577. * - \e outmask |= Geodesic::AZIMUTH for the latitude \e azi2;
  578. * - \e outmask |= Geodesic::DISTANCE for the distance \e s12;
  579. * - \e outmask |= Geodesic::REDUCEDLENGTH for the reduced length \e
  580. * m12;
  581. * - \e outmask |= Geodesic::GEODESICSCALE for the geodesic scales \e
  582. * M12 and \e M21;
  583. * - \e outmask |= Geodesic::AREA for the area \e S12;
  584. * - \e outmask |= Geodesic::ALL for all of the above;
  585. * - \e outmask |= Geodesic::LONG_UNROLL to unroll \e lon2 instead of
  586. * wrapping it into the range [&minus;180&deg;, 180&deg;].
  587. * .
  588. * The function value \e a12 is always computed and returned and this
  589. * equals \e s12_a12 is \e arcmode is true. If \e outmask includes
  590. * Geodesic::DISTANCE and \e arcmode is false, then \e s12 = \e s12_a12.
  591. * It is not necessary to include Geodesic::DISTANCE_IN in \e outmask; this
  592. * is automatically included is \e arcmode is false.
  593. *
  594. * With the Geodesic::LONG_UNROLL bit set, the quantity \e lon2 &minus; \e
  595. * lon1 indicates how many times and in what sense the geodesic encircles
  596. * the ellipsoid.
  597. **********************************************************************/
  598. Math::real GenDirect(real lat1, real lon1, real azi1,
  599. bool arcmode, real s12_a12, unsigned outmask,
  600. real& lat2, real& lon2, real& azi2,
  601. real& s12, real& m12, real& M12, real& M21,
  602. real& S12) const;
  603. ///@}
  604. /** \name Inverse geodesic problem.
  605. **********************************************************************/
  606. ///@{
  607. /**
  608. * Solve the inverse geodesic problem.
  609. *
  610. * @param[in] lat1 latitude of point 1 (degrees).
  611. * @param[in] lon1 longitude of point 1 (degrees).
  612. * @param[in] lat2 latitude of point 2 (degrees).
  613. * @param[in] lon2 longitude of point 2 (degrees).
  614. * @param[out] s12 distance between point 1 and point 2 (meters).
  615. * @param[out] azi1 azimuth at point 1 (degrees).
  616. * @param[out] azi2 (forward) azimuth at point 2 (degrees).
  617. * @param[out] m12 reduced length of geodesic (meters).
  618. * @param[out] M12 geodesic scale of point 2 relative to point 1
  619. * (dimensionless).
  620. * @param[out] M21 geodesic scale of point 1 relative to point 2
  621. * (dimensionless).
  622. * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
  623. * @return \e a12 arc length of between point 1 and point 2 (degrees).
  624. *
  625. * \e lat1 and \e lat2 should be in the range [&minus;90&deg;, 90&deg;].
  626. * The values of \e azi1 and \e azi2 returned are in the range
  627. * [&minus;180&deg;, 180&deg;].
  628. *
  629. * If either point is at a pole, the azimuth is defined by keeping the
  630. * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;),
  631. * and taking the limit &epsilon; &rarr; 0+.
  632. *
  633. * The solution to the inverse problem is found using Newton's method. If
  634. * this fails to converge (this is very unlikely in geodetic applications
  635. * but does occur for very eccentric ellipsoids), then the bisection method
  636. * is used to refine the solution.
  637. *
  638. * The following functions are overloaded versions of Geodesic::Inverse
  639. * which omit some of the output parameters. Note, however, that the arc
  640. * length is always computed and returned as the function value.
  641. **********************************************************************/
  642. Math::real Inverse(real lat1, real lon1, real lat2, real lon2,
  643. real& s12, real& azi1, real& azi2, real& m12,
  644. real& M12, real& M21, real& S12) const {
  645. return GenInverse(lat1, lon1, lat2, lon2,
  646. DISTANCE | AZIMUTH |
  647. REDUCEDLENGTH | GEODESICSCALE | AREA,
  648. s12, azi1, azi2, m12, M12, M21, S12);
  649. }
  650. /**
  651. * See the documentation for Geodesic::Inverse.
  652. **********************************************************************/
  653. Math::real Inverse(real lat1, real lon1, real lat2, real lon2,
  654. real& s12) const {
  655. real t;
  656. return GenInverse(lat1, lon1, lat2, lon2,
  657. DISTANCE,
  658. s12, t, t, t, t, t, t);
  659. }
  660. /**
  661. * See the documentation for Geodesic::Inverse.
  662. **********************************************************************/
  663. Math::real Inverse(real lat1, real lon1, real lat2, real lon2,
  664. real& azi1, real& azi2) const {
  665. real t;
  666. return GenInverse(lat1, lon1, lat2, lon2,
  667. AZIMUTH,
  668. t, azi1, azi2, t, t, t, t);
  669. }
  670. /**
  671. * See the documentation for Geodesic::Inverse.
  672. **********************************************************************/
  673. Math::real Inverse(real lat1, real lon1, real lat2, real lon2,
  674. real& s12, real& azi1, real& azi2)
  675. const {
  676. real t;
  677. return GenInverse(lat1, lon1, lat2, lon2,
  678. DISTANCE | AZIMUTH,
  679. s12, azi1, azi2, t, t, t, t);
  680. }
  681. /**
  682. * See the documentation for Geodesic::Inverse.
  683. **********************************************************************/
  684. Math::real Inverse(real lat1, real lon1, real lat2, real lon2,
  685. real& s12, real& azi1, real& azi2, real& m12)
  686. const {
  687. real t;
  688. return GenInverse(lat1, lon1, lat2, lon2,
  689. DISTANCE | AZIMUTH | REDUCEDLENGTH,
  690. s12, azi1, azi2, m12, t, t, t);
  691. }
  692. /**
  693. * See the documentation for Geodesic::Inverse.
  694. **********************************************************************/
  695. Math::real Inverse(real lat1, real lon1, real lat2, real lon2,
  696. real& s12, real& azi1, real& azi2,
  697. real& M12, real& M21) const {
  698. real t;
  699. return GenInverse(lat1, lon1, lat2, lon2,
  700. DISTANCE | AZIMUTH | GEODESICSCALE,
  701. s12, azi1, azi2, t, M12, M21, t);
  702. }
  703. /**
  704. * See the documentation for Geodesic::Inverse.
  705. **********************************************************************/
  706. Math::real Inverse(real lat1, real lon1, real lat2, real lon2,
  707. real& s12, real& azi1, real& azi2, real& m12,
  708. real& M12, real& M21) const {
  709. real t;
  710. return GenInverse(lat1, lon1, lat2, lon2,
  711. DISTANCE | AZIMUTH |
  712. REDUCEDLENGTH | GEODESICSCALE,
  713. s12, azi1, azi2, m12, M12, M21, t);
  714. }
  715. ///@}
  716. /** \name General version of inverse geodesic solution.
  717. **********************************************************************/
  718. ///@{
  719. /**
  720. * The general inverse geodesic calculation. Geodesic::Inverse is defined
  721. * in terms of this function.
  722. *
  723. * @param[in] lat1 latitude of point 1 (degrees).
  724. * @param[in] lon1 longitude of point 1 (degrees).
  725. * @param[in] lat2 latitude of point 2 (degrees).
  726. * @param[in] lon2 longitude of point 2 (degrees).
  727. * @param[in] outmask a bitor'ed combination of Geodesic::mask values
  728. * specifying which of the following parameters should be set.
  729. * @param[out] s12 distance between point 1 and point 2 (meters).
  730. * @param[out] azi1 azimuth at point 1 (degrees).
  731. * @param[out] azi2 (forward) azimuth at point 2 (degrees).
  732. * @param[out] m12 reduced length of geodesic (meters).
  733. * @param[out] M12 geodesic scale of point 2 relative to point 1
  734. * (dimensionless).
  735. * @param[out] M21 geodesic scale of point 1 relative to point 2
  736. * (dimensionless).
  737. * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
  738. * @return \e a12 arc length of between point 1 and point 2 (degrees).
  739. *
  740. * The Geodesic::mask values possible for \e outmask are
  741. * - \e outmask |= Geodesic::DISTANCE for the distance \e s12;
  742. * - \e outmask |= Geodesic::AZIMUTH for the latitude \e azi2;
  743. * - \e outmask |= Geodesic::REDUCEDLENGTH for the reduced length \e
  744. * m12;
  745. * - \e outmask |= Geodesic::GEODESICSCALE for the geodesic scales \e
  746. * M12 and \e M21;
  747. * - \e outmask |= Geodesic::AREA for the area \e S12;
  748. * - \e outmask |= Geodesic::ALL for all of the above.
  749. * .
  750. * The arc length is always computed and returned as the function value.
  751. **********************************************************************/
  752. Math::real GenInverse(real lat1, real lon1, real lat2, real lon2,
  753. unsigned outmask,
  754. real& s12, real& azi1, real& azi2,
  755. real& m12, real& M12, real& M21, real& S12) const;
  756. ///@}
  757. /** \name Interface to GeodesicLine.
  758. **********************************************************************/
  759. ///@{
  760. /**
  761. * Set up to compute several points on a single geodesic.
  762. *
  763. * @param[in] lat1 latitude of point 1 (degrees).
  764. * @param[in] lon1 longitude of point 1 (degrees).
  765. * @param[in] azi1 azimuth at point 1 (degrees).
  766. * @param[in] caps bitor'ed combination of Geodesic::mask values
  767. * specifying the capabilities the GeodesicLine object should possess,
  768. * i.e., which quantities can be returned in calls to
  769. * GeodesicLine::Position.
  770. * @return a GeodesicLine object.
  771. *
  772. * \e lat1 should be in the range [&minus;90&deg;, 90&deg;].
  773. *
  774. * The Geodesic::mask values are
  775. * - \e caps |= Geodesic::LATITUDE for the latitude \e lat2; this is
  776. * added automatically;
  777. * - \e caps |= Geodesic::LONGITUDE for the latitude \e lon2;
  778. * - \e caps |= Geodesic::AZIMUTH for the azimuth \e azi2; this is
  779. * added automatically;
  780. * - \e caps |= Geodesic::DISTANCE for the distance \e s12;
  781. * - \e caps |= Geodesic::REDUCEDLENGTH for the reduced length \e m12;
  782. * - \e caps |= Geodesic::GEODESICSCALE for the geodesic scales \e M12
  783. * and \e M21;
  784. * - \e caps |= Geodesic::AREA for the area \e S12;
  785. * - \e caps |= Geodesic::DISTANCE_IN permits the length of the
  786. * geodesic to be given in terms of \e s12; without this capability the
  787. * length can only be specified in terms of arc length;
  788. * - \e caps |= Geodesic::ALL for all of the above.
  789. * .
  790. * The default value of \e caps is Geodesic::ALL.
  791. *
  792. * If the point is at a pole, the azimuth is defined by keeping \e lon1
  793. * fixed, writing \e lat1 = &plusmn;(90 &minus; &epsilon;), and taking the
  794. * limit &epsilon; &rarr; 0+.
  795. **********************************************************************/
  796. GeodesicLine Line(real lat1, real lon1, real azi1, unsigned caps = ALL)
  797. const;
  798. /**
  799. * Define a GeodesicLine in terms of the inverse geodesic problem.
  800. *
  801. * @param[in] lat1 latitude of point 1 (degrees).
  802. * @param[in] lon1 longitude of point 1 (degrees).
  803. * @param[in] lat2 latitude of point 2 (degrees).
  804. * @param[in] lon2 longitude of point 2 (degrees).
  805. * @param[in] caps bitor'ed combination of Geodesic::mask values
  806. * specifying the capabilities the GeodesicLine object should possess,
  807. * i.e., which quantities can be returned in calls to
  808. * GeodesicLine::Position.
  809. * @return a GeodesicLine object.
  810. *
  811. * This function sets point 3 of the GeodesicLine to correspond to point 2
  812. * of the inverse geodesic problem.
  813. *
  814. * \e lat1 and \e lat2 should be in the range [&minus;90&deg;, 90&deg;].
  815. **********************************************************************/
  816. GeodesicLine InverseLine(real lat1, real lon1, real lat2, real lon2,
  817. unsigned caps = ALL) const;
  818. /**
  819. * Define a GeodesicLine in terms of the direct geodesic problem specified
  820. * in terms of distance.
  821. *
  822. * @param[in] lat1 latitude of point 1 (degrees).
  823. * @param[in] lon1 longitude of point 1 (degrees).
  824. * @param[in] azi1 azimuth at point 1 (degrees).
  825. * @param[in] s12 distance between point 1 and point 2 (meters); it can be
  826. * negative.
  827. * @param[in] caps bitor'ed combination of Geodesic::mask values
  828. * specifying the capabilities the GeodesicLine object should possess,
  829. * i.e., which quantities can be returned in calls to
  830. * GeodesicLine::Position.
  831. * @return a GeodesicLine object.
  832. *
  833. * This function sets point 3 of the GeodesicLine to correspond to point 2
  834. * of the direct geodesic problem.
  835. *
  836. * \e lat1 should be in the range [&minus;90&deg;, 90&deg;].
  837. **********************************************************************/
  838. GeodesicLine DirectLine(real lat1, real lon1, real azi1, real s12,
  839. unsigned caps = ALL) const;
  840. /**
  841. * Define a GeodesicLine in terms of the direct geodesic problem specified
  842. * in terms of arc length.
  843. *
  844. * @param[in] lat1 latitude of point 1 (degrees).
  845. * @param[in] lon1 longitude of point 1 (degrees).
  846. * @param[in] azi1 azimuth at point 1 (degrees).
  847. * @param[in] a12 arc length between point 1 and point 2 (degrees); it can
  848. * be negative.
  849. * @param[in] caps bitor'ed combination of Geodesic::mask values
  850. * specifying the capabilities the GeodesicLine object should possess,
  851. * i.e., which quantities can be returned in calls to
  852. * GeodesicLine::Position.
  853. * @return a GeodesicLine object.
  854. *
  855. * This function sets point 3 of the GeodesicLine to correspond to point 2
  856. * of the direct geodesic problem.
  857. *
  858. * \e lat1 should be in the range [&minus;90&deg;, 90&deg;].
  859. **********************************************************************/
  860. GeodesicLine ArcDirectLine(real lat1, real lon1, real azi1, real a12,
  861. unsigned caps = ALL) const;
  862. /**
  863. * Define a GeodesicLine in terms of the direct geodesic problem specified
  864. * in terms of either distance or arc length.
  865. *
  866. * @param[in] lat1 latitude of point 1 (degrees).
  867. * @param[in] lon1 longitude of point 1 (degrees).
  868. * @param[in] azi1 azimuth at point 1 (degrees).
  869. * @param[in] arcmode boolean flag determining the meaning of the \e
  870. * s12_a12.
  871. * @param[in] s12_a12 if \e arcmode is false, this is the distance between
  872. * point 1 and point 2 (meters); otherwise it is the arc length between
  873. * point 1 and point 2 (degrees); it can be negative.
  874. * @param[in] caps bitor'ed combination of Geodesic::mask values
  875. * specifying the capabilities the GeodesicLine object should possess,
  876. * i.e., which quantities can be returned in calls to
  877. * GeodesicLine::Position.
  878. * @return a GeodesicLine object.
  879. *
  880. * This function sets point 3 of the GeodesicLine to correspond to point 2
  881. * of the direct geodesic problem.
  882. *
  883. * \e lat1 should be in the range [&minus;90&deg;, 90&deg;].
  884. **********************************************************************/
  885. GeodesicLine GenDirectLine(real lat1, real lon1, real azi1,
  886. bool arcmode, real s12_a12,
  887. unsigned caps = ALL) const;
  888. ///@}
  889. /** \name Inspector functions.
  890. **********************************************************************/
  891. ///@{
  892. /**
  893. * @return \e a the equatorial radius of the ellipsoid (meters). This is
  894. * the value used in the constructor.
  895. **********************************************************************/
  896. Math::real EquatorialRadius() const { return _a; }
  897. /**
  898. * @return \e f the flattening of the ellipsoid. This is the
  899. * value used in the constructor.
  900. **********************************************************************/
  901. Math::real Flattening() const { return _f; }
  902. /**
  903. * @return total area of ellipsoid in meters<sup>2</sup>. The area of a
  904. * polygon encircling a pole can be found by adding
  905. * Geodesic::EllipsoidArea()/2 to the sum of \e S12 for each side of the
  906. * polygon.
  907. **********************************************************************/
  908. Math::real EllipsoidArea() const
  909. { return 4 * Math::pi() * _c2; }
  910. /**
  911. * \deprecated An old name for EquatorialRadius().
  912. **********************************************************************/
  913. GEOGRAPHICLIB_DEPRECATED("Use EquatorialRadius()")
  914. Math::real MajorRadius() const { return EquatorialRadius(); }
  915. ///@}
  916. /**
  917. * A global instantiation of Geodesic with the parameters for the WGS84
  918. * ellipsoid.
  919. **********************************************************************/
  920. static const Geodesic& WGS84();
  921. };
  922. } // namespace GeographicLib
  923. #endif // GEOGRAPHICLIB_GEODESIC_HPP