Professional Documents
Culture Documents
Department of Surveying Engineering, National Technical University of Athens, Zografou Campus, 15780 Athens, Greece
Abstract:
The geodesic between two given points on an ellipsoid is determined as a numerical solution of a boundary value problem. The second-
order ordinary differential equation of the geodesic is formulated by means of the Euler-Lagrange equation of the calculus of variations.
Using Taylor’s theorem, the boundary value problem with Dirichlet conditions at the end points is replaced by an initial value problem with
Dirichlet and Neumann conditions. The Neumann condition is determined iteratively by solving a system of four rst-order differential
equations with numerical integration. Once the correct Neumann value has been computed, the solution of the boundary value problem
is also obtained. Using a special case of the Euler-Lagrange equation, the Clairaut equation is veri ed and the Clairaut constant is precisely
determined. The azimuth at any point along the geodesic is computed by a simple formula. The geodesic distance between two points, as
a de nite integral, is computed by numerical integration. The numerical tests are validated by comparison to Vincenty’s inverse formulas.
Keywords:
boundary value problem • Clairaut constant • geodesics • inverse geodesic problem • numerical integration
© Versita sp. z o.o.
x = N cos ϕ cos λ (2a) We assume that λ0 ̸= λ1 since the case where λ0 = λ1 can be ex-
cluded as a trivial one: all meridians on the ellipsoid are geodesics,
y = N cos ϕ sin λ (2b) the azimuths α along the meridian are 0 or π , and the geodesic dis-
tance s between two points located at the meridian can be com-
( )
z = N 1 − e2 sin ϕ (2c) puted by the well-known meridian distance formula (Rapp, 1984).
Moreover, without loss of generality, we shall always consider that
where –π /2 6 ϕ 6 +π /2 is the geodetic latitude, –π < λ 6 +π is
the geodetic longitude and
λ0 < λ1 , which implies that 0 < α < π . Also, the poles are
excluded and hence it holds that G ̸= 0.
a The computation of the geodesic between two points P0 (ϕ0 ,λ0 )
N= √ (3)
1− e2 2
sin ϕ and P1 (ϕ1 ,λ1 ) on the ellipsoid entails determining the curve ϕ
= ϕ (λ) with ϕ0 = ϕ (λ0 ) and ϕ1 = ϕ (λ1 ) such that the length in
is the radius of curvature in the prime vertical normal section. In Eq. (10) is minimum. This implies that the (smooth) geodesic ϕ
this parametrization, the rst fundamental coefficients E, F, and = ϕ (λ) must satisfy the Euler-Lagrange equation of the calculus of
G are (Deakin and Hunter, 2008) variations (van Brunt, 2004; Logan, 2006)
( )2
a 2 1 − e2 ( )
E= ( )3 (4) d ∂f ∂f
− = 0. (12)
1 − e2 sin2 ϕ dλ ∂ϕ ′ ∂ϕ
42
Journal of Geodetic Science
In our case, using Eq. (11) we obtain 3. From a boundary to an initial value problem
∂f E ′ (ϕ ′ )2 + G ′
= √ (14) d ( )
∂ϕ 2 E(ϕ ′ )2 + G (ϕ) = f1 ϕ ′ , ϕ (20a)
dλ
where d ( ′) ( )
ϕ = f2 ϕ ′ , ϕ (20b)
dλ
dE ′ dG where
E′ = ,G = . (15)
dϕ dϕ
( )
f1 ϕ ′ , ϕ = ϕ ′ (21)
By writing out the total derivative in Eq. (12) using the chain rule,
the Euler-Lagrange equation becomes
and
∂2 f ∂2 f ∂2 f ∂f ( ) ( )2
′ ′
ϕ ′′ + ′
ϕ′ + − =0 (16) f2 ϕ ′ , ϕ = h1 ϕ ′ + h2 (22)
∂ϕ ∂ϕ ∂ϕ∂ϕ ∂λ∂ϕ ′ ∂ϕ
with
where
G′ 1 E′
d2 ϕ h1 = − (23)
ϕ = ′′
(17) G 2E
dλ2
1 G′
( ) h2 = . (24)
and the term ∂2 f
= ∂ ∂f
= 0 in our case. Substituting 2 E
∂λ∂ϕ ′ ∂λ ∂ϕ ′
Eqs. (13) and (14) into Eq. (16) subsequently yields
The initial values associated with this system are
( ) ( )2
2EGϕ ′′ − 2EG ′ − E ′ G ϕ ′ − GG ′ = 0 (18) D : ϕ0 = ϕ(λ0 ) (25a)
(0) (0)
ϕ(ϕ ′ 0 , ϕ0 ; λ1 ) = ϕ1 ̸= ϕ1 . (30) Figure 1. The geodesic on the ellipsoid.
(0)
Therefore, we search for a correction δϕ ′ 0 such that
and via numerical integration on the interval [λ0 , λ1 ] we determine
(0) (0) the geodesic
ϕ(ϕ ′ 0 + δϕ ′ 0 , ϕ0 ; λ1 ) = ϕ1 . (31)
(1)
Using Taylor’s theorem (second and higher order terms ignored), Γ(1) : ϕ = ϕ(ϕ ′ 0 , ϕ0 ; λ) (37)
Eq. (31) can be written as
( ) with
(0) ∂ϕ (0)
ϕ1 = ϕ(ϕ ′ 0 , ϕ0 ; λ1 ) + δϕ ′ 0 (32)
∂ϕ ′ 0 (0) 1 (1)
ϕ(ϕ ′ 0 , ϕ0 ; λ1 ) = ϕ1 (1) ̸= ϕ1 . (38)
and from Eqs. (30), (31) and (32) we then obtain
Using the results at λ1
(0)
(0) ϕ1 − ϕ1
δϕ ′ 0 = ( ) . (33) ( )
∂ϕ ∂ϕ
∂ϕ ′ 0 (0) 1
ϕ1 (1) , (39)
∂ϕ ′ 0 (1) 1
Hence, we can integrate the system of Eqs. (20) and (34) on the (m)
ϕ1 − ϕ1 < ε (41)
interval [λ0 , λ1 ] and obtain at λ1 the values
and Equations (49) may give inaccurate results, since the evaluation of
the arccosine suffers for arguments very close to 1 (i.e., very small
∂h2 angles). We cannot overemphasize that Eqs. (48) and (49) serve
h4 = . (45)
∂ϕ only to provide an initial value for x2 , such that the accuracy of
this value is of no real concern. This differentiates our approach
We now observe that x2′ and x4′ are expressed in terms of the x1 , x2 from the efforts of Saito (1970), Vincenty (1975), and others in ad-
and x1 , x2 , x3 , x4 , respectively. Performing the necessary manipu- dressing the small angle problem. Furthermore, in our method one
lations, Eqs. (23), (24), (44) and (45) are then rewritten as could instead use the very simple approximation formula
( )
2 1 − e2 tan ϕ + 3e2 sin ϕ cos ϕ (0) ϕ1 − ϕ0
h1 = − (46a) x2 = ϕ ′ 0 = (50)
1 − e2 sin2 ϕ λ1 − λ0
( )
1 − e2 sin2 ϕ sin ϕ cos ϕ
h2 = − (46b) for the initial value of x2 .
1 − e2
Subsequently, in each iteration this value is corrected according to
( ) 1 − e2 sin2 ϕ + 2e2 sin2 ϕ cos2 ϕ the method discussed in Section 3. Finally, the variables x3 and x4
h3 = −2 1 − e2 ( )2
1 − e2 sin2 ϕ cos2 ϕ always have initial values of 0 and 1, respectively.
( )( )
1 − e2 sin2 ϕ cos2 ϕ − sin2 ϕ + 2e2 sin2 ϕ cos2 ϕ 5. Clairaut’s constant
− 3e2 ( )2
1 − e2 sin2 ϕ
The function f in Eq. (11) does not contain the independent vari-
(46c) able λ explicitly. Therefore, along any geodesic ϕ = ϕ (λ) it holds
( 2
)( 2 2
) 2
1 − e sin ϕ cos ϕ − sin ϕ − 2e sin ϕ cos2 ϕ
2 2
that
h4 = − .
1 − e2
(46d) ∂f
f − ϕ′ =C (51)
∂ϕ ′
Hence, the system of the four rst-order differential equations (43)
can be solved on the interval [λ0 , λ1 ] using a numerical integration where C is a constant (van Brunt, 2004).
method such as Runge-Kutta or a Taylor series (see Butcher, 1987). Equation (51), which is a special case of the Euler-Lagrange equa-
The required initial conditions are described below. tion (Eq. (12)), has been previously seen in the literature (e.g.,
Journal of Geodetic Science 45
Struik, 1961; Karney and Deakin, 2010). In contrast, we make use of which gives – π /2 6 α 6 π /2. Since λ0 ̸= λ1 , α ̸= 0. When
the complete expression, Eq. (18), and the constant C in Eq. (51) the azimuth is negative, the correct azimuth is obtained as α = α
is computed immediately below. + π . One should note that Eq. (56) involves the variables x1 = ϕ
Substituting Eqs. (11) and (13) into Eq. (51) we obtain and x2 = ϕ ’, which are obtained by the numerical integration. Also,
the forward azimuth α01 at P0 (ϕ0 ,λ0 ) is α01 = α0 and the reverse
G azimuth at P1 (ϕ1 ,λ1 ) is α10 = α1 + π .
√ = C. (52)
E(ϕ ′ )2 + G Finally, the geodesic distance s between the two points P0 (ϕ0 ,λ0 )
and P1 (ϕ1 ,λ1 ), using Eqs. (10) and (11) is written as a de nite in-
However, for any curve on the ellipsoid, we can write tegral
√
G ∫ λ1 √
′
ϕ = √ cot α. (53) s= E(ϕ ′ )2 + Gdλ (57)
E λ0
Substituting Eq. (53) into Eq. (52) and using Eqs. (3) and (6) yields
which can be computed by a numerical integration method such
as the Newton–Cotes formulas (see, e.g., Hildebrand, 1974).
N cos ϕ sin α = C (54)
7. Numerical tests and comparisons
which is the Clairaut equation. Hence, Eqs. (52) and (54) are equiv-
In order to validate the algorithm which has been presented, the
alent and the Clairaut constant C can be computed by Eq. (52) at
results were compared to those obtained using the Vincenty’s in-
any value of the independent variable λ. Furthermore, since 0 < α
verse formulas. Because the problem is invariant under rotations
< π , Eq. (54) implies that 0 < C < a.
around the z-axis, only starting points (ϕ0 ,λ0 ) with λ0 = 0◦ and ϕ0
We also note that Eq. (52) involves the variables x1 = ϕ and x2
= 0◦ , 30◦ , 60◦ and 75◦ (symmetry) were selected, as well as points
= ϕ ’, which are obtained by the numerical integration. In this
(ϕ1 ,λ1 ) with λ1 = 5◦ , 40◦ , 80◦ , 120◦ , 160◦ and 170◦ and ϕ1 = –
way, one can check the accuracy of the numerical integration and
75◦ , – 60◦ , – 30◦ , 0◦ , 30◦ , 60◦ , and 75◦ . Note that, when ϕ0 = 0◦
subsequently compute the azimuths along the geodesic and the
only the values ϕ1 > 0◦ were used. Hence, in total 150 geodesics
geodesic distance between two given points.
were tested. In our selection of the points and, especially, the
6. Azimuths and geodesic distance maximum value of 170◦ for the longitude difference (λ1 –λ0 ), we
followed the rationale of similar works, like Thomas and Feath-
Traditionally, once the Clairaut constant C is known, the azimuth
erstone (2005) and Sjöberg and Shirazian (2012), who limit their
α at any point along the geodesic can be computed by solving comparisons with Vincenty’s method to geodesic distances up to
Eq. (54) in α . This equation has two solutions
19000 km. All the numerical computations were carried out using
( ) the GRS80 ellipsoid (Moritz, 1980), meaning that a = 6378137 m
C
α = arcsin (55a) and b = 6356752.3141 m. All algorithms were implemented in
N cos ϕ MATLAB.
( ) The system of four rst-order differential equations (43) was
C
α = π − arcsin (55b) solved using the fourth-order Runge-Kutta numerical integration
N cos ϕ
method. The number of steps n was selected as 8000 in order to
cover all cases with sufficient accuracy. Thus, the maximum step
but this problem can be eliminated, allowing computation of the
size δλ corresponds to 1.275 minutes of arc. The latitudes at λ1
correct azimuth (Sjöberg and Shirazian, 2012). Also, at the ver-
were required to converge with an accuracy ε = 10−12 rad, which
tex point (i.e., the point with maximum/minimum latitude and az-
corresponds to approximately 0.006 mm. As a result, in all cases,
imuth π /2), it holds that C = N cos ϕ . It is well-known that the
the iterative procedure reached convergence in three or four iter-
derivative of arcsine is large for arguments near 1. Thus, small er-
ations. In any particular geodesic, the Clairaut constant C, which
rors in C /(N cos ϕ ) due to factors such as computer rounding of
was computed using Eq. (52) at all values of the independent vari-
oating point numbers, will produce large errors in the calcula-
able λ, had a maximum discrepancy 0.02 mm. Also, the geodesic
tion of azimuth (Thomas and Featherstone, 2005). Hence, using
distance s between the two points, given by Eq. (57), was com-
Eqs. (55) is likely to lead to inaccurate azimuths near the vertex.
puted by Simpson’s rule (i.e. the three point rule). For this study,
In order to avoid the previous problems, we compute the azimuth
Vincenty’s algorithm (Vincenty, 1975) was implemented with the
α at any point along the geodesic by solving Eq. (53),
requirement that the longitude differences were to converge with
(√ ) an accuracy 10−12 rad ≈ 0.006 mm.
E
α = arccot √ ϕ′ (56) The results between our proposed method and Vincenty’s inverse
G method show agreement to within 6×10−6 seconds of arc for az-
46
Journal of Geodetic Science
Table 1. Numerical tests and comparisons with Vincenty’s inverse method.
imuth and 0.12 mm (mean value of differences) in geodesic dis- opportunity for use in many recent geodetic works dealing with
tance(up to 0.58 mm in the worst case). A small sample of results is the transformation problems on the triaxial ellipsoid, such as Fel-
presented in Table 1. The differences in the geodesic distances that tens (2009) and Ligas (2012a, 2012b). Finally, by setting e = 0, the
appear in the last column of Table 1 are a consequence of our initial method is reduced to the sphere, i.e. showing that the geodesics
selection of the number of steps. We calculated the geodesics for on the sphere are obtained as a degenerate case.
a few special cases, using twice the usual number of steps (16000
instead of 8000). These results are presented in Table 2. Acknowledgments
For geodesics between near antipodal points, Saito (1970) pointed
The authors would like to thank Dr. G. Manoussakis, Department
out that all methods based on conformal mapping are problematic
of Surveying Engineering, National Technical University of Athens,
and he proposed a method to face this antipodal problem. More
recently, Karney (2013) has also also attempted to solve this prob- for his many suggestions and helpful comments on the various as-
pects of this research. We extend our appreciation to the reviewers
lem. Since our method is not based on a conformal mapping, we
tested it using two special cases and the results are also shown in of the original manuscript for their many constructive and useful
◦ remarks.
Table 2. In these cases we used a longitude difference up to 179.5
and our solution converges to the required accuracy after only 5
iterations. References
8. Concluding remarks
Butcher J. C., 1987, The numerical analysis of ordinary differ-
The method presented here describes the geodesic between two ential equations: Runge-Kutta and general linear methods,
given points on the ellipsoid as a two-point boundary value prob- Wiley, New York.
lem. Using Taylor’s theorem and a numerical integration method,
this problem is replaced by an initial value problem. From its so- Deakin R. E. and Hunter M. N., 2008, Geometric Geodesy -
lution the coordinates and the azimuths at any point along the Part A, Lecture Notes, School of Mathematical & Geospatial
geodesic are determined. Also, the Clairaut constant is deter- Sciences, RMIT University, Melbourne, Australia.
mined together with an accuracy check. The numerical tests show
that the solutions practically agree with Vincenty’s inverse solu- Deakin R. E. and Hunter M. N., 2010, Geometric Geodesy -
tions. Hence, this method can be used as an algorithm to plot Part B, Lecture Notes, School of Mathematical & Geospatial
the geodesic between two given points on the ellipsoid. As an Sciences, RMIT University, Melbourne, Australia.
independent method it can be used to validate Vincenty’s inverse
method and moreover is able to provide an accurate solution to the Feltens J., 2009, Vector method to compute the Cartesian
geodesic problem even in extreme cases, such as between points (X , Y , Z ) to geodetic (ϕ , λ, h) transformation on a triaxial
nearly antipodal to one another. ellipsoid, J. Geod., 83, 129-137.
The present method is universal in character and thus can be used
to describe the geodesics on a triaxial ellipsoid. This presents an Fox L., 1990, The numerical solution of two-point bound-
Journal of Geodetic Science
ary problems in ordinary differential equations, Dover, New Geod., 54, 395-405.
York.
Rapp R. H., 1984, Geometric Geodesy - Part I, Department
Hildebrand F. B., 1974, Introduction to numerical analysis, of Geodetic Science and Surveying, Ohio State University,
2nd ed., Dover, New York. Columbus, Ohio, USA.
Jank W. and Kivioja L. A., 1980, Solution of the direct and Rapp R. H., 1993, Geometric Geodesy - Part II, Department
inverse problems on reference ellipsoids by point-by-point of Geodetic Science and Surveying, Ohio State University,
integration using programmable pocket calculators, Surveying Columbus, Ohio, USA.
and Mapping, 15, 325-337.
Saito T., 1970, The computation of long geodesics on the
Karney C. F. F. and Deakin R. E., 2010, F.W. Bessel (1825): ellipsoid by non-series expanding procedure, Bull. Geod., 98,
The calculation of longitude and latitude from geodesic 341-373.
measurements, Astron. Nachr., 331, 852-861.
Sjöberg L. E., 2007, Precise determination of the Clairaut
Karney C. F. F., 2013, Algorithms for geodesics, J. Geod., constant in ellipsoidal geodesy, Surv. Rev., 39, 81-86.
87, 43-55.
Sjöberg L. E. and Shirazian M., 2012, Solving the direct
Keller H. B., 1992, Numerical methods for two-point boundary- and inverse geodetic problems on the ellipsoid by numerical
value problems, Dover, New York. integration, J. Surv. Eng., 138, 9-16.
Kivioja L. A., 1971, Computation of geodetic direct and Struik, D. J., 1961, Lectures on classical differential geom-
indirect problems by computers accumulating increments etry, 2nd ed., Dover, New York.
from geodetic line elements, Bull. Geod., 99, 55-63.
Thomas C. M. and Featherstone W. E., 2005, Validation of
Ligas M., 2012a, Cartesian to geodetic coordinates con- Vincenty’s formulas for the geodesic using a new fourth-order
version on a triaxial ellipsoid, J. Geod., 86, 249-256. extension of Kivioja’s formula, J. Surv. Eng., 131, 20-26.
Ligas M., 2012b, Two modi ed algorithms to transform van Brunt B., 2004, The calculus of variations, Springer-
Cartesian to geodetic coordinates on a triaxial ellipsoid, Stud. Verlag, New York.
Geoph. Geod., 56, 993-1006.
Vincenty T., 1975, Direct and inverse solutions of geodesics on
Logan J. D., 2006, Applied mathematics, 3rd ed., Wiley- the ellipsoid with application of nested equations, Surv. Rev.,
Interscience, New Jersey. 23, 88-93.