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