Back to resource page for geodesics.

Addenda for C. F. F. Karney, Algorithms for Geodesics, J. Geodesy 87(1), 43–55 (Jan. 2013);
DOI: 10.1007/s00190-012-0578-z.

  1. Implementations of the geodesic routines are now available in C, Fortran, Java, JavaScript, Python, and Octave/MATLAB (in addition to C++). For details see this link.
  2. Care needs to be taken when solving the inverse problem for a non-equatorial geodesic when both end points on the equator. In Table 5, the quadrants for σ1 and ω1 must be determined taking sinσ1 and sinω1 to be negative; this is consistent with the ordering ϕ10.
  3. The 6th-order series given in the paper provide solutions for the geodesic problem which are accurate to round off for |f|<0.01. The least accurate of the series is the reverted series for σ in terms of τ, Eqs. (20) and (21), which is used only in solving the direct problem. The accuracy can be improved by using these equations to give an initial approximation for σ which is following by one step of Newton's method applied to Eq. (7), with dI1(σ)/dσ=1+k2sin2σ. With this change (which need only be applied for |f|>0.01), the 6th-order series are accurate to round-off for |f|<0.02.
  4. Equation (63) give expansions for the area integral using e2 and k2 as small parameters. Unfortunately the resulting series diverges for e>1 or b/a<1/2. This problem is remedied by expanding instead in terms of n and ϵ. Thus Eq. (63) becomes C40=(23415n+8105n2+4315n3+163465n4+209009n5)(151635n+32105n216385n36415015n4)ϵ(2105+32315n10883465n2+11845005n3)ϵ2+(113153683465n326435n2)ϵ3+(41155+108845045n)ϵ4+9715015ϵ5+,C41=(14516315n+32945n2163465n364135135n4)ϵ(210564945n+1281485n2198445045n3)ϵ2(1105162079n5792135135n2)ϵ3+(411552944135135n)ϵ4+19009ϵ5+,C42=(4525321575n+643465n2325005n3)ϵ2(815751285775n+2566825n2)ϵ3(819251856225225n)ϵ4+810725ϵ5+,C43=(8220525624255n+51245045n2)ϵ3(1680851024105105n)ϵ413663063ϵ5+,C44=(643118551281081n)ϵ4128135135ϵ5+,C45=12899099ϵ5+.
  5. In some applications, it is necessary to keep track of how many times a geodesic encircles the earth, i.e., to determine the value of λ12 without reducing it to some canonical range. The geodesic classes offer this option through the Geodesic::LONG_UNROLL mask bit. In the case of the inverse problem, we are interested in the shortest geodesic and thus λ12[π,π] (the geodesic between points on opposite meridians is taken to be east- or west-going depending on whether λ2λ1 is positive or negative). When solving the direct geodesic problem, σ12 is found in terms of the length of the geodesic, ω and σ pass from one quadrant to the next at the same time, and they are related by tanω=sinα0tanσ. The "unrolled" value of λ12 is then given by ω12=E[σ12(tan1sinσ2cosσ2tan1sinσ1cosσ1)+(tan1Esinω2cosω2tan1Esinω1cosω1)],λ12=ω12fsinα0(I3(σ2)I3(σ1)), where E=±1 is the sign of sinα0 or +1 if sinα0=0.
  6. The starting guesses for Newton's method given in Sec. 5 are not very good for highly eccentric ellipsoids. It's possible to modify Newton's method so that it converges even for poor initial guesses. The goal is to find the root of f(α1)λ12(α1)λ12=0, where λ12(α1) is the solution of the hybrid problem. There is exactly one root to this equation in the interval α1(0,π) and its derivative f(α1) is positive at the root. During the course of the iteration, a range (α1a,α1b) is maintained which brackets the root and with each evaluation of f(α1) the range is shrunk, if possible. Newton's method is restarted whenever the derivative of f(α1) is negative (because the new value of α1 is then further from the solution) or if the new estimate of α1 lies outside (0,π); in this case, the new starting guess is taken to be (α1a+α1b)/2.
  7. The series for A2 converges slightly faster it is multiplied by 1+ϵ, instead of divided by 1ϵ. The resulting series is A2=(1+ϵ)1(134ϵ2764ϵ411256ϵ6+).
  8. In order to obtain accurate solutions for ellipsoids of arbitrary eccentricity, it is necessary to replace the series expansions for the integrals (which are valid only if f is small) with direct evaluation in terms of elliptic integrals (which are valid for all f). The key relations used are sb=E(σ,ik),λ=χe21+e2sinα0H(σ,e2,ik),J(σ)=k2D(σ,ik), where tanχ=1+e21+k2sin2σtanω,H(ϕ,α2,k)=1α2F(ϕ,k)+(11α2)Π(ϕ,α2,k), and F(ϕ,k), E(ϕ,k), D(ϕ,k), and Π(ϕ,α2,k), are incomplete elliptic integrals (see https://dlmf.nist.gov/19.2.ii).
  9. The integral I4(σ), Eq. (61), appearing in the expression for the area Eq. (59), does not appear to be an elliptic integral. When the formulation of geodesics in terms elliptic integrals was first provided in GeographicLib, a 30th order series for I4(σ) was used, expanded in terms of n and ϵ as in item 4 above. This provided full accuracy in double precision for 12b/a2. Here we detail how to obtain accuracy over a wider range. We start by writing Eq. (61) as I4=π/2σq(σ)dσ,q(σ)=Δt(e2,k2sin2σ)sinσ2,Δt(x,y)=t(x)t(y)xy,t(x>0)=x+(1+xsinh1xx1),t(x<0)=x+(1+xsin1xx1),t(0)=0. The notation Δt(x,y) is used for the divided difference of t(x) and, because t(x) involves just elementary functions, there's a systematic way to put it in a form that avoids subtracting nearly equal quantities as explained by Kahan and Fateman (1999). From the symmetries of the sine function, it's clear that we can expand q(σ) in a Fourier series q(σ)=l=0Qlsin((2l+1)σ), so that we have I4(σ)=l=0C4lcos((2l+1)σ),C4l=Ql2l+1; this is Eq. (62) in the paper. Instead of determining Ql using a Taylor expansion (as in the paper and in item 4), we use the discrete sine transform and compute Ql=2Nj=0Npjq(σj)sin((2l+1)σj) for 0l<N, where σj=jπ/(2N) and pj=12 for j=0 or j=N and 1 otherwise. Using the fast Fourier transform (FFT), Ql may be computed efficiently; using the FFT also minimizes round-off errors in computing the sum. In addition, this yields an excellent approximation to the true value of Ql: the number of correct digits approximately doubles as N is doubled. This is a consequence of the fact that the trapezium rule (or, equivalently, the rectangle rule) converges faster than any power of N when computing an integral over a full period of a smooth periodic function. N is adjusted to give full accuracy for 0.01b/a100.
  10. Google Books does not consistently provide access to the full text. If you encounter this situation, you can download the pdf files listed here:
Items 3–9 represent changes since the publication of the paper. Changes 3–7 have been implemented in the GeographicLib classes Geodesic and GeodesicLine in GeographicLib versions 1.27, 1.26, 1.39 (fixed in 1.43), 1.25, and 1.44, respectively. Change 8 (the evaluation of the integrals in terms of elliptic integrals) is implemented in the GeographicLib classes GeodesicExact and GeodesicLineExact which were added to GeographicLib 1.25. Change 9 (the accurate computation of geodesic areas) was added to these classes in GeographicLib 2.1. For geodetic applications, Geodesic and GeodesicLine are preferred, because they are about 2–3 times faster and the round-off errors are about 2–3 times smaller.

Some notes on geodesics on a triaxial ellipsoid are given in Geodesics on a triaxial ellipsoid. This examines the solution to this problem found by Jacobi in 1839.

Errata for C. F. F. Karney, Algorithms for Geodesics, arXiv:1109.4448v2 (2012-03-28).

These errata apply to the preprint only:

Errata for C. F. F. Karney, Geodesics on an ellipsoid of revolution arXiv:1102.1215v1 (2011-02-07).

Addenda:

Errata:

Back to resource page for geodesics.
Charles Karney <karney@alum.mit.edu> (2022-06-08)

GeographicLib home