GeographicLib 2.2
GeodesicLineExact.hpp
Go to the documentation of this file.
1/**
2 * \file GeodesicLineExact.hpp
3 * \brief Header for GeographicLib::GeodesicLineExact class
4 *
5 * Copyright (c) Charles Karney (2012-2023) <charles@karney.com> and licensed
6 * under the MIT/X11 License. For more information, see
7 * https://geographiclib.sourceforge.io/
8 **********************************************************************/
9
10#if !defined(GEOGRAPHICLIB_GEODESICLINEEXACT_HPP)
11#define GEOGRAPHICLIB_GEODESICLINEEXACT_HPP 1
12
16#include <vector>
17
18namespace GeographicLib {
19
20 /**
21 * \brief An exact geodesic line
22 *
23 * GeodesicLineExact facilitates the determination of a series of points on a
24 * single geodesic. This is a companion to the GeodesicExact class. For
25 * additional information on this class see the documentation on the
26 * GeodesicLine class.
27 *
28 * Example of use:
29 * \include example-GeodesicLineExact.cpp
30 *
31 * <a href="GeodSolve.1.html">GeodSolve</a> is a command-line utility
32 * providing access to the functionality of GeodesicExact and
33 * GeodesicLineExact (via the -E option).
34 **********************************************************************/
35
37 private:
38 typedef Math::real real;
39 friend class GeodesicExact;
40 int _nC4;
41
42 real tiny_;
43 real _lat1, _lon1, _azi1;
44 real _a, _f, _b, _c2, _f1, _e2, _salp0, _calp0, _k2,
45 _salp1, _calp1, _ssig1, _csig1, _dn1, _stau1, _ctau1,
46 _somg1, _comg1, _cchi1,
47 _aA4, _eE0, _dD0, _hH0, _eE1, _dD1, _hH1;
48 real _a13, _s13;
49 real _bB41;
50 std::vector<real> _cC4a;
52 unsigned _caps;
53
54 void LineInit(const GeodesicExact& g,
55 real lat1, real lon1,
56 real azi1, real salp1, real calp1,
57 unsigned caps);
59 real lat1, real lon1,
60 real azi1, real salp1, real calp1,
61 unsigned caps, bool arcmode, real s13_a13);
62
63 enum captype {
64 CAP_NONE = GeodesicExact::CAP_NONE,
65 CAP_E = GeodesicExact::CAP_E,
66 CAP_D = GeodesicExact::CAP_D,
67 CAP_H = GeodesicExact::CAP_H,
68 CAP_C4 = GeodesicExact::CAP_C4,
69 CAP_ALL = GeodesicExact::CAP_ALL,
70 CAP_MASK = GeodesicExact::CAP_MASK,
71 OUT_ALL = GeodesicExact::OUT_ALL,
72 OUT_MASK = GeodesicExact::OUT_MASK,
73 };
74 public:
75
76 /**
77 * Bit masks for what calculations to do. They signify to the
78 * GeodesicLineExact::GeodesicLineExact constructor and to
79 * GeodesicExact::Line what capabilities should be included in the
80 * GeodesicLineExact object. This is merely a duplication of
81 * GeodesicExact::mask.
82 **********************************************************************/
83 enum mask {
84 /**
85 * No capabilities, no output.
86 * @hideinitializer
87 **********************************************************************/
89 /**
90 * Calculate latitude \e lat2. (It's not necessary to include this as a
91 * capability to GeodesicLineExact because this is included by default.)
92 * @hideinitializer
93 **********************************************************************/
95 /**
96 * Calculate longitude \e lon2.
97 * @hideinitializer
98 **********************************************************************/
100 /**
101 * Calculate azimuths \e azi1 and \e azi2. (It's not necessary to
102 * include this as a capability to GeodesicLineExact because this is
103 * included by default.)
104 * @hideinitializer
105 **********************************************************************/
107 /**
108 * Calculate distance \e s12.
109 * @hideinitializer
110 **********************************************************************/
112 /**
113 * A combination of the common capabilities: GeodesicLineExact::LATITUDE,
114 * GeodesicLineExact::LONGITUDE, GeodesicLineExact::AZIMUTH,
115 * GeodesicLineExact::DISTANCE.
116 * @hideinitializer
117 **********************************************************************/
119 /**
120 * Allow distance \e s12 to be used as input in the direct geodesic
121 * problem.
122 * @hideinitializer
123 **********************************************************************/
125 /**
126 * Calculate reduced length \e m12.
127 * @hideinitializer
128 **********************************************************************/
130 /**
131 * Calculate geodesic scales \e M12 and \e M21.
132 * @hideinitializer
133 **********************************************************************/
135 /**
136 * Calculate area \e S12.
137 * @hideinitializer
138 **********************************************************************/
140 /**
141 * Unroll \e lon2 in the direct calculation.
142 * @hideinitializer
143 **********************************************************************/
145 /**
146 * All capabilities, calculate everything. (LONG_UNROLL is not
147 * included in this mask.)
148 * @hideinitializer
149 **********************************************************************/
151 };
152
153 /** \name Constructors
154 **********************************************************************/
155 ///@{
156
157 /**
158 * Constructor for a geodesic line staring at latitude \e lat1, longitude
159 * \e lon1, and azimuth \e azi1 (all in degrees).
160 *
161 * @param[in] g A GeodesicExact object used to compute the necessary
162 * information about the GeodesicLineExact.
163 * @param[in] lat1 latitude of point 1 (degrees).
164 * @param[in] lon1 longitude of point 1 (degrees).
165 * @param[in] azi1 azimuth at point 1 (degrees).
166 * @param[in] caps bitor'ed combination of GeodesicLineExact::mask values
167 * specifying the capabilities the GeodesicLineExact object should
168 * possess, i.e., which quantities can be returned in calls to
169 * GeodesicLine::Position.
170 *
171 * \e lat1 should be in the range [&minus;90&deg;, 90&deg;].
172 *
173 * The GeodesicLineExact::mask values are
174 * - \e caps |= GeodesicLineExact::LATITUDE for the latitude \e lat2; this
175 * is added automatically;
176 * - \e caps |= GeodesicLineExact::LONGITUDE for the latitude \e lon2;
177 * - \e caps |= GeodesicLineExact::AZIMUTH for the latitude \e azi2; this
178 * is added automatically;
179 * - \e caps |= GeodesicLineExact::DISTANCE for the distance \e s12;
180 * - \e caps |= GeodesicLineExact::REDUCEDLENGTH for the reduced length \e
181 * m12;
182 * - \e caps |= GeodesicLineExact::GEODESICSCALE for the geodesic scales \e
183 * M12 and \e M21;
184 * - \e caps |= GeodesicLineExact::AREA for the area \e S12;
185 * - \e caps |= GeodesicLineExact::DISTANCE_IN permits the length of the
186 * geodesic to be given in terms of \e s12; without this capability the
187 * length can only be specified in terms of arc length;
188 * - \e caps |= GeodesicLineExact::ALL for all of the above.
189 * .
190 * The default value of \e caps is GeodesicLineExact::ALL.
191 *
192 * If the point is at a pole, the azimuth is defined by keeping \e lon1
193 * fixed, writing \e lat1 = &plusmn;(90&deg; &minus; &epsilon;), and taking
194 * the limit &epsilon; &rarr; 0+.
195 **********************************************************************/
197 GeodesicLineExact(const GeodesicExact& g, real lat1, real lon1, real azi1,
198 unsigned caps = ALL);
199
200 /**
201 * A default constructor. If GeodesicLineExact::Position is called on the
202 * resulting object, it returns immediately (without doing any
203 * calculations). The object can be set with a call to
204 * GeodesicExact::Line. Use Init() to test whether object is still in this
205 * uninitialized state.
206 **********************************************************************/
208 ///@}
209
210 /** \name Position in terms of distance
211 **********************************************************************/
212 ///@{
213
214 /**
215 * Compute the position of point 2 which is a distance \e s12 (meters)
216 * from point 1.
217 *
218 * @param[in] s12 distance from point 1 to point 2 (meters); it can be
219 * signed.
220 * @param[out] lat2 latitude of point 2 (degrees).
221 * @param[out] lon2 longitude of point 2 (degrees); requires that the
222 * GeodesicLineExact object was constructed with \e caps |=
223 * GeodesicLineExact::LONGITUDE.
224 * @param[out] azi2 (forward) azimuth at point 2 (degrees).
225 * @param[out] m12 reduced length of geodesic (meters); requires that the
226 * GeodesicLineExact object was constructed with \e caps |=
227 * GeodesicLineExact::REDUCEDLENGTH.
228 * @param[out] M12 geodesic scale of point 2 relative to point 1
229 * (dimensionless); requires that the GeodesicLineExact object was
230 * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE.
231 * @param[out] M21 geodesic scale of point 1 relative to point 2
232 * (dimensionless); requires that the GeodesicLineExact object was
233 * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE.
234 * @param[out] S12 area under the geodesic (meters<sup>2</sup>); requires
235 * that the GeodesicLineExact object was constructed with \e caps |=
236 * GeodesicLineExact::AREA.
237 * @return \e a12 arc length from point 1 to point 2 (degrees).
238 *
239 * The values of \e lon2 and \e azi2 returned are in the range
240 * [&minus;180&deg;, 180&deg;].
241 *
242 * The GeodesicLineExact object \e must have been constructed with \e caps
243 * |= GeodesicLineExact::DISTANCE_IN; otherwise Math::NaN() is returned and
244 * no parameters are set. Requesting a value which the GeodesicLineExact
245 * object is not capable of computing is not an error; the corresponding
246 * argument will not be altered.
247 *
248 * The following functions are overloaded versions of
249 * GeodesicLineExact::Position which omit some of the output parameters.
250 * Note, however, that the arc length is always computed and returned as
251 * the function value.
252 **********************************************************************/
253 Math::real GEOGRAPHICLIB_EXPORT Position(real s12, real& lat2, real& lon2,
254 real& azi2,
255 real& m12, real& M12, real& M21,
256 real& S12) const {
257 real t;
258 return GenPosition(false, s12,
261 lat2, lon2, azi2, t, m12, M12, M21, S12);
262 }
263
264 /**
265 * See the documentation for GeodesicLineExact::Position.
266 **********************************************************************/
267 Math::real GEOGRAPHICLIB_EXPORT Position(real s12, real& lat2, real& lon2)
268 const {
269 real t;
270 return GenPosition(false, s12,
272 lat2, lon2, t, t, t, t, t, t);
273 }
274
275 /**
276 * See the documentation for GeodesicLineExact::Position.
277 **********************************************************************/
278 Math::real GEOGRAPHICLIB_EXPORT Position(real s12, real& lat2, real& lon2,
279 real& azi2) const {
280 real t;
281 return GenPosition(false, s12,
283 lat2, lon2, azi2, t, t, t, t, t);
284 }
285
286 /**
287 * See the documentation for GeodesicLineExact::Position.
288 **********************************************************************/
289 Math::real GEOGRAPHICLIB_EXPORT Position(real s12, real& lat2, real& lon2,
290 real& azi2, real& m12) const {
291 real t;
292 return GenPosition(false, s12,
295 lat2, lon2, azi2, t, m12, t, t, t);
296 }
297
298 /**
299 * See the documentation for GeodesicLineExact::Position.
300 **********************************************************************/
301 Math::real GEOGRAPHICLIB_EXPORT Position(real s12, real& lat2, real& lon2,
302 real& azi2, real& M12, real& M21)
303 const {
304 real t;
305 return GenPosition(false, s12,
308 lat2, lon2, azi2, t, t, M12, M21, t);
309 }
310
311 /**
312 * See the documentation for GeodesicLineExact::Position.
313 **********************************************************************/
315 real& lat2, real& lon2, real& azi2,
316 real& m12, real& M12, real& M21)
317 const {
318 real t;
319 return GenPosition(false, s12,
322 lat2, lon2, azi2, t, m12, M12, M21, t);
323 }
324 ///@}
325
326 /** \name Position in terms of arc length
327 **********************************************************************/
328 ///@{
329
330 /**
331 * Compute the position of point 2 which is an arc length \e a12 (degrees)
332 * from point 1.
333 *
334 * @param[in] a12 arc length from point 1 to point 2 (degrees); it can
335 * be signed.
336 * @param[out] lat2 latitude of point 2 (degrees).
337 * @param[out] lon2 longitude of point 2 (degrees); requires that the
338 * GeodesicLineExact object was constructed with \e caps |=
339 * GeodesicLineExact::LONGITUDE.
340 * @param[out] azi2 (forward) azimuth at point 2 (degrees).
341 * @param[out] s12 distance from point 1 to point 2 (meters); requires
342 * that the GeodesicLineExact object was constructed with \e caps |=
343 * GeodesicLineExact::DISTANCE.
344 * @param[out] m12 reduced length of geodesic (meters); requires that the
345 * GeodesicLineExact object was constructed with \e caps |=
346 * GeodesicLineExact::REDUCEDLENGTH.
347 * @param[out] M12 geodesic scale of point 2 relative to point 1
348 * (dimensionless); requires that the GeodesicLineExact object was
349 * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE.
350 * @param[out] M21 geodesic scale of point 1 relative to point 2
351 * (dimensionless); requires that the GeodesicLineExact object was
352 * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE.
353 * @param[out] S12 area under the geodesic (meters<sup>2</sup>); requires
354 * that the GeodesicLineExact object was constructed with \e caps |=
355 * GeodesicLineExact::AREA.
356 *
357 * The values of \e lon2 and \e azi2 returned are in the range
358 * [&minus;180&deg;, 180&deg;].
359 *
360 * Requesting a value which the GeodesicLineExact object is not capable of
361 * computing is not an error; the corresponding argument will not be
362 * altered.
363 *
364 * The following functions are overloaded versions of
365 * GeodesicLineExact::ArcPosition which omit some of the output parameters.
366 **********************************************************************/
368 ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
369 real& s12, real& m12, real& M12, real& M21,
370 real& S12) const {
371 GenPosition(true, a12,
374 lat2, lon2, azi2, s12, m12, M12, M21, S12);
375 }
376
377 /**
378 * See the documentation for GeodesicLineExact::ArcPosition.
379 **********************************************************************/
380 void GEOGRAPHICLIB_EXPORT ArcPosition(real a12, real& lat2, real& lon2)
381 const {
382 real t;
383 GenPosition(true, a12,
385 lat2, lon2, t, t, t, t, t, t);
386 }
387
388 /**
389 * See the documentation for GeodesicLineExact::ArcPosition.
390 **********************************************************************/
392 real& lat2, real& lon2, real& azi2)
393 const {
394 real t;
395 GenPosition(true, a12,
397 lat2, lon2, azi2, t, t, t, t, t);
398 }
399
400 /**
401 * See the documentation for GeodesicLineExact::ArcPosition.
402 **********************************************************************/
404 real& lat2, real& lon2, real& azi2,
405 real& s12) const {
406 real t;
407 GenPosition(true, a12,
409 lat2, lon2, azi2, s12, t, t, t, t);
410 }
411
412 /**
413 * See the documentation for GeodesicLineExact::ArcPosition.
414 **********************************************************************/
416 real& lat2, real& lon2, real& azi2,
417 real& s12, real& m12) const {
418 real t;
419 GenPosition(true, a12,
422 lat2, lon2, azi2, s12, m12, t, t, t);
423 }
424
425 /**
426 * See the documentation for GeodesicLineExact::ArcPosition.
427 **********************************************************************/
429 real& lat2, real& lon2, real& azi2,
430 real& s12, real& M12, real& M21)
431 const {
432 real t;
433 GenPosition(true, a12,
436 lat2, lon2, azi2, s12, t, M12, M21, t);
437 }
438
439 /**
440 * See the documentation for GeodesicLineExact::ArcPosition.
441 **********************************************************************/
443 ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
444 real& s12, real& m12, real& M12, real& M21)
445 const {
446 real t;
447 GenPosition(true, a12,
450 lat2, lon2, azi2, s12, m12, M12, M21, t);
451 }
452 ///@}
453
454 /** \name The general position function.
455 **********************************************************************/
456 ///@{
457
458 /**
459 * The general position function. GeodesicLineExact::Position and
460 * GeodesicLineExact::ArcPosition are defined in terms of this function.
461 *
462 * @param[in] arcmode boolean flag determining the meaning of the second
463 * parameter; if \e arcmode is false, then the GeodesicLineExact object
464 * must have been constructed with \e caps |=
465 * GeodesicLineExact::DISTANCE_IN.
466 * @param[in] s12_a12 if \e arcmode is false, this is the distance between
467 * point 1 and point 2 (meters); otherwise it is the arc length between
468 * point 1 and point 2 (degrees); it can be signed.
469 * @param[in] outmask a bitor'ed combination of GeodesicLineExact::mask
470 * values specifying which of the following parameters should be set.
471 * @param[out] lat2 latitude of point 2 (degrees).
472 * @param[out] lon2 longitude of point 2 (degrees); requires that the
473 * GeodesicLineExact object was constructed with \e caps |=
474 * GeodesicLineExact::LONGITUDE.
475 * @param[out] azi2 (forward) azimuth at point 2 (degrees).
476 * @param[out] s12 distance from point 1 to point 2 (meters); requires
477 * that the GeodesicLineExact object was constructed with \e caps |=
478 * GeodesicLineExact::DISTANCE.
479 * @param[out] m12 reduced length of geodesic (meters); requires that the
480 * GeodesicLineExact object was constructed with \e caps |=
481 * GeodesicLineExact::REDUCEDLENGTH.
482 * @param[out] M12 geodesic scale of point 2 relative to point 1
483 * (dimensionless); requires that the GeodesicLineExact object was
484 * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE.
485 * @param[out] M21 geodesic scale of point 1 relative to point 2
486 * (dimensionless); requires that the GeodesicLineExact object was
487 * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE.
488 * @param[out] S12 area under the geodesic (meters<sup>2</sup>); requires
489 * that the GeodesicLineExact object was constructed with \e caps |=
490 * GeodesicLineExact::AREA.
491 * @return \e a12 arc length from point 1 to point 2 (degrees).
492 *
493 * The GeodesicLineExact::mask values possible for \e outmask are
494 * - \e outmask |= GeodesicLineExact::LATITUDE for the latitude \e lat2;
495 * - \e outmask |= GeodesicLineExact::LONGITUDE for the latitude \e lon2;
496 * - \e outmask |= GeodesicLineExact::AZIMUTH for the latitude \e azi2;
497 * - \e outmask |= GeodesicLineExact::DISTANCE for the distance \e s12;
498 * - \e outmask |= GeodesicLineExact::REDUCEDLENGTH for the reduced length
499 * \e m12;
500 * - \e outmask |= GeodesicLineExact::GEODESICSCALE for the geodesic scales
501 * \e M12 and \e M21;
502 * - \e outmask |= GeodesicLineExact::AREA for the area \e S12;
503 * - \e outmask |= GeodesicLineExact::ALL for all of the above;
504 * - \e outmask |= GeodesicLineExact::LONG_UNROLL to unroll \e lon2 instead
505 * of wrapping it into the range [&minus;180&deg;, 180&deg;].
506 * .
507 * Requesting a value which the GeodesicLineExact object is not capable of
508 * computing is not an error; the corresponding argument will not be
509 * altered. Note, however, that the arc length is always computed and
510 * returned as the function value.
511 *
512 * With the GeodesicLineExact::LONG_UNROLL bit set, the quantity \e lon2
513 * &minus; \e lon1 indicates how many times and in what sense the geodesic
514 * encircles the ellipsoid.
515 **********************************************************************/
517 GenPosition(bool arcmode, real s12_a12, unsigned outmask,
518 real& lat2, real& lon2, real& azi2,
519 real& s12, real& m12, real& M12, real& M21, real& S12) const;
520 ///@}
521
522 /** \name Setting point 3
523 **********************************************************************/
524 ///@{
525
526 /**
527 * Specify position of point 3 in terms of distance.
528 *
529 * @param[in] s13 the distance from point 1 to point 3 (meters); it
530 * can be negative.
531 *
532 * This is only useful if the GeodesicLineExact object has been constructed
533 * with \e caps |= GeodesicLineExact::DISTANCE_IN.
534 **********************************************************************/
536
537 /**
538 * Specify position of point 3 in terms of arc length.
539 *
540 * @param[in] a13 the arc length from point 1 to point 3 (degrees); it
541 * can be negative.
542 *
543 * The distance \e s13 is only set if the GeodesicLineExact object has been
544 * constructed with \e caps |= GeodesicLineExact::DISTANCE.
545 **********************************************************************/
547
548 /**
549 * Specify position of point 3 in terms of either distance or arc length.
550 *
551 * @param[in] arcmode boolean flag determining the meaning of the second
552 * parameter; if \e arcmode is false, then the GeodesicLineExact object
553 * must have been constructed with \e caps |=
554 * GeodesicLineExact::DISTANCE_IN.
555 * @param[in] s13_a13 if \e arcmode is false, this is the distance from
556 * point 1 to point 3 (meters); otherwise it is the arc length from
557 * point 1 to point 3 (degrees); it can be negative.
558 **********************************************************************/
559 void GEOGRAPHICLIB_EXPORT GenSetDistance(bool arcmode, real s13_a13);
560
561 /** \name Inspector functions
562 **********************************************************************/
563 ///@{
564
565 /**
566 * @return true if the object has been initialized.
567 **********************************************************************/
568 bool GEOGRAPHICLIB_EXPORT Init() const { return _caps != 0U; }
569
570 /**
571 * @return \e lat1 the latitude of point 1 (degrees).
572 **********************************************************************/
574 { return Init() ? _lat1 : Math::NaN(); }
575
576 /**
577 * @return \e lon1 the longitude of point 1 (degrees).
578 **********************************************************************/
580 { return Init() ? _lon1 : Math::NaN(); }
581
582 /**
583 * @return \e azi1 the azimuth (degrees) of the geodesic line at point 1.
584 **********************************************************************/
586 { return Init() ? _azi1 : Math::NaN(); }
587
588 /**
589 * The sine and cosine of \e azi1.
590 *
591 * @param[out] sazi1 the sine of \e azi1.
592 * @param[out] cazi1 the cosine of \e azi1.
593 **********************************************************************/
594 void GEOGRAPHICLIB_EXPORT Azimuth(real& sazi1, real& cazi1) const
595 { if (Init()) { sazi1 = _salp1; cazi1 = _calp1; } }
596
597 /**
598 * @return \e azi0 the azimuth (degrees) of the geodesic line as it crosses
599 * the equator in a northward direction.
600 *
601 * The result lies in [&minus;90&deg;, 90&deg;].
602 **********************************************************************/
604 { return Init() ? Math::atan2d(_salp0, _calp0) : Math::NaN(); }
605
606 /**
607 * The sine and cosine of \e azi0.
608 *
609 * @param[out] sazi0 the sine of \e azi0.
610 * @param[out] cazi0 the cosine of \e azi0.
611 **********************************************************************/
612 void GEOGRAPHICLIB_EXPORT EquatorialAzimuth(real& sazi0, real& cazi0) const
613 { if (Init()) { sazi0 = _salp0; cazi0 = _calp0; } }
614
615 /**
616 * @return \e a1 the arc length (degrees) between the northward equatorial
617 * crossing and point 1.
618 *
619 * The result lies in [&minus;180&deg;, 180&deg;].
620 **********************************************************************/
622 using std::atan2;
623 return Init() ? atan2(_ssig1, _csig1) / Math::degree() : Math::NaN();
624 }
625
626 /**
627 * @return \e a the equatorial radius of the ellipsoid (meters). This is
628 * the value inherited from the GeodesicExact object used in the
629 * constructor.
630 **********************************************************************/
633
634 /**
635 * @return \e f the flattening of the ellipsoid. This is the value
636 * inherited from the GeodesicExact object used in the constructor.
637 **********************************************************************/
639 { return Init() ? _f : Math::NaN(); }
640
641 /**
642 * @return \e caps the computational capabilities that this object was
643 * constructed with. LATITUDE and AZIMUTH are always included.
644 **********************************************************************/
645 unsigned GEOGRAPHICLIB_EXPORT Capabilities() const { return _caps; }
646
647 /**
648 * Test what capabilities are available.
649 *
650 * @param[in] testcaps a set of bitor'ed GeodesicLineExact::mask values.
651 * @return true if the GeodesicLineExact object has all these capabilities.
652 **********************************************************************/
653 bool GEOGRAPHICLIB_EXPORT Capabilities(unsigned testcaps) const {
654 testcaps &= OUT_ALL;
655 return (_caps & testcaps) == testcaps;
656 }
657
658 /**
659 * The distance or arc length to point 3.
660 *
661 * @param[in] arcmode boolean flag determining the meaning of returned
662 * value.
663 * @return \e s13 if \e arcmode is false; \e a13 if \e arcmode is true.
664 **********************************************************************/
666 { return Init() ? (arcmode ? _a13 : _s13) : Math::NaN(); }
667
668 /**
669 * @return \e s13, the distance to point 3 (meters).
670 **********************************************************************/
672 { return GenDistance(false); }
673
674 /**
675 * @return \e a13, the arc length to point 3 (degrees).
676 **********************************************************************/
678 ///@}
679
680 };
681
682} // namespace GeographicLib
683
684#endif // GEOGRAPHICLIB_GEODESICLINEEXACT_HPP
Header for GeographicLib::Constants class.
#define GEOGRAPHICLIB_EXPORT
Definition Constants.hpp:67
Header for GeographicLib::EllipticFunction class.
GeographicLib::Math::real real
Definition GeodSolve.cpp:31
Header for GeographicLib::GeodesicExact class.
Elliptic integrals and functions.
Exact geodesic calculations.
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2) const
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12) const
void EquatorialAzimuth(real &sazi0, real &cazi0) const
Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask, real &lat2, real &lon2, real &azi2, real &s12, real &m12, real &M12, real &M21, real &S12) const
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12, real &M12, real &M21, real &S12) const
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12, real &M12, real &M21, real &S12) const
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &M12, real &M21) const
void ArcPosition(real a12, real &lat2, real &lon2) const
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &M12, real &M21) const
Math::real GenDistance(bool arcmode) const
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12, real &M12, real &M21) const
Math::real Position(real s12, real &lat2, real &lon2) const
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12) const
void GenSetDistance(bool arcmode, real s13_a13)
bool Capabilities(unsigned testcaps) const
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12, real &M12, real &M21) const
void Azimuth(real &sazi1, real &cazi1) const
Math::real Position(real s12, real &lat2, real &lon2, real &azi2) const
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12) const
static T degree()
Definition Math.hpp:200
static T atan2d(T y, T x)
Definition Math.cpp:183
static T NaN()
Definition Math.cpp:250
Namespace for GeographicLib.