geodesics on an ellipsoid of revolution.pdf

Upload: hammoudeh13

Post on 31-Oct-2015

67 views

Category:

Documents


0 download

DESCRIPTION

GR

TRANSCRIPT

  • arX

    iv:1

    102.

    1215

    v1 [

    phys

    ics.ge

    o-ph

    ] 7 F

    eb 20

    11Link http://geographiclib.sourceforge.net/geod.html

    Geodesics on an ellipsoid of revolutionCharles F. F. Karney

    SRI International, 201 Washington Rd, Princeton, NJ 08543-5300, USA

    (Dated: February 7, 2011)Algorithms for the computation of the forward and inverse geodesic problems for an ellipsoid of revolution arederived. These are accurate to better than 15 nm when applied to the terrestrial ellipsoids. The solutions ofother problems involving geodesics (triangulation, projections, maritime boundaries, and polygonal areas) areinvestigated.

    Keywords: geometrical geodesy, geodesics, map projections, triangulation, maritime boundaries, polygonalareas, numerical methods

    1. INTRODUCTION

    A geodesic is the natural straight line, defined as theline of minimum curvature, for the surface of the earth(Hilbert and Cohn-Vossen, 1952, pp. 220222). Geodesicsare also of interest because the shortest path between twopoints on the earth is always a geodesic (although the con-verse is not necessarily true). In most terrestrial applications,the earth is taking to be an ellipsoid of revolution and I adoptthis model in this paper.

    Consider two points A, at latitude and longitude (1, 1),and B, at (2, 2), on the surface of the earth connected by

    0

    2

    1s12 2

    1

    12

    E FH

    N

    A

    B

    FIG. 1 The ellipsoidal triangle NAB. N is the north pole, NA andNB are meridians, and AB is a geodesic of length s12. The longi-tude of B relative to A is 12; the latitudes of A and B are 1 and2. EFH is the equator with E also lying on the extension of thegeodesic AB; and 0, 1, and 2 are the azimuths of the geodesicat E, A, and B.

    Electronic address: [email protected]

    a geodesic. Denote the bearings of the geodesic (measuredclockwise from north) at A and B by 1 and 2, respectively,and the length of the geodesic by s12; see Fig. 1. There are twomain geodesic problems: the direct problem, given 1, s12,and 1 determine 2, 12 = 2 1, and 2; and the inverseproblem, given the 1, 2, and 12, determine s12, 1, and2.Considering the ellipsoidal triangle,NAB, in Fig. 1, whereNis the north pole, it is clear that both problems are equivalentto solving the triangle given two sides and the included angle.In the first half of this paper (Secs. 29), I present solutions tothese problems: the accuracy of the solutions is limited onlyby the precision of the number system of the computer; thedirect solution is non-iterative; the inverse solution is iterativebut always converges in a few iterations. In the second half(Secs. 1015), I discuss several applications of geodesics.

    This paper has had a rather elephantine gestation. My ini-tial work in this area grew out of a dissatisfaction with thewidely used algorithms for the main geodesic problems givenby Vincenty (1975a). These have two flaws: firstly, the al-gorithms are given to a fixed order in the flattening of theellipsoid thereby limiting their accuracy; more seriously, thealgorithm for the inverse problem fails in the case of nearlyantipodal points. Starting with the overview of the problemgiven by Williams (2002), I cured the defects noted above andincluded the algorithms in GeographicLib (Karney, 2010) inMarch 2009. At the same time, I started writing this paper andin the course of this I came across references in, for example,Rainsford (1955) to work by Euler, Legendre, and Bessel. Be-cause no specific citations were given, I initially ignored thesereferences. However, when I finally stumbled across Besselspaper on geodesics (Bessel, 1825), I was like some watcherof the skies when a new planet swims into his ken. Overlook-ing minor quirks of notation and the use of logarithms for nu-merical calculations, Bessel gives a formulation and solutionof the direct geodesic problem which is as clear, as concise,and as modern as any I have read. However, I was surprisedto discover that Bessel derived series expansions for the geo-desic integrals which are more economical than those usedin the English-language literature of the 20th century. Thisprompted me to undertake a systematic search for the other

  • 2original papers on geodesics, the fruits of which are availableon-line (Karney, 2009). These contained other little knownresultsprobably the most important of which is the conceptof the reduced length (Sect. 3) which have been incorpo-rated into the geodesic classes in GeographicLib.

    Some authors define spheroid as an ellipsoid of revolu-tion. In this paper, I use the term in its more general sense,as an approximately spherical figure. Although this paper isprincipally concerned the earth modeled as an ellipsoid of rev-olution, there are two sections where the analysis is more gen-eral: (1) in the development of the auxiliary sphere, Sect. 2and Appendix A, which applies to a spheroid of revolution;(2) in the generalization of the gnomonic projection, Sect. 13,which applies to a general spheroid.

    2. AUXILIARY SPHERE

    The study of geodesics on an ellipsoid of revolution waspursued by many authors in the 18th and 19th centuries. Theimportant early papers are by Clairaut (1735), Euler (1755),Dionis du Sejour (1789, Book 1, Chaps. 13), Legendre(1789, 1806), and Oriani (1806, 1808, 1810). Clairaut (1735)found an invariant for a geodesic (a consequence of the ro-tational symmetry of the ellipsoid); this reduces the equa-tions for the geodesic to quadrature. Subsequently, Legendre(1806) and Oriani (1806) reduced the spheroidal triangle inFig. 1 into an equivalent triangle on the auxiliary sphere.Bessel (1825) provided a method (using tables that he sup-plied) to compute the necessary integrals and allowed the di-rect problem to be solved with an accuracy of a few centime-ters. In this section, I summarize this formulation of geo-desics; more details are given in Appendix A in which thederivation of the auxiliary sphere is given.

    I consider an ellipsoid of revolution with equatorial radiusa, and polar semi-axis b, flattening f , third flattening n, ec-centricity e, and second eccentricity e given by

    f = (a b)/a, (1)n = (a b)/(a+ b) = f/(2 f), (2)e2 = (a2 b2)/a2 = f(2 f), (3)e2 = (a2 b2)/b2 = e2/(1 e2). (4)

    In this paper, I am primarily concerned with oblate ellipsoids(a > b); however, with a few exceptions, the formulas applyto prolate ellipsoids merely by allowing f < 0 and e2 < 0.(Appendix D addresses the modifications necessary to treatprolate ellipsoids in more detail.) Most of the examples in thispaper use the WGS84 ellipsoid for which a = 6378.137kmand f = 1/298.257223563. (In the illustrative examples,numbers given in boldface are exact. The other numbers areobtained by rounding the exact result to the given number ofplaces.) The surface of the ellipsoid is characterized by itsmeridional and transverse radii of curvature,

    =a

    1 f w3, (5)

    =a

    1 f w, (6)

    0

    (s) ()

    ()

    E G

    N

    P

    FIG. 2 The elementary ellipsoidal triangleNEP mapped to the aux-iliary sphere. NE and NPG are meridians; EG is the equator;and EP is the geodesic. The corresponding ellipsoidal variables areshown in parentheses.

    respectively, where

    w =1

    1 + e2 cos2 . (7)

    Consider a geodesic which intersects the equator, = 0, inthe northwards direction with azimuth (measured clockwisefrom north) 0 [ 12, 12]. I denote this equatorial cross-ing point E and this is taken as the origin for the longitude and for measuring (signed) displacements s along the geode-sic. Because this definition of longitude depends on the geo-desic, longitude differences must be computed for points onthe same geodesic. Consider now a point P with latitude ,longitude , a displacement s along the geodesic and form theellipsoidal triangle NEP where N represents the north pole.The (forward) azimuth of the geodesic atP is (i.e., the angleNPE is ).

    Appendix A shows how this triangle may be transferred tothe auxiliary sphere where the latitude on the sphere is thereduced latitude , given by

    tan = (1 f) tan (8)(Legendre, 1806, p. 136), azimuths (0 and ) are conserved,the longitude is denoted by , and EP is a portion of agreat circle with arc length ; see Fig. 2. (Cayley (1870,p. 331) suggested the term parametric latitude for becausethis is the angle most commonly used when the meridian el-lipse is written in parametric form.) Applying Napiers rulesof circular parts (Todhunter, 1871, 66) to the right triangleEPG in Fig. 2 gives a set of relations that apply cyclically to[0,

    12 , 12 , , ],

    sin0 = sin cos (9)= tan cot, (10)

    cos = cos cos (11)= tan0 cot, (12)

  • 3cos = cos cos0 (13)= cot tan, (14)

    sin = cos0 sin (15)= cot tan, (16)

    sin = sin sin (17)= tan tan0. (18)

    In solving the main geodesic problems, I let P stand for A orB with the quantities , , , , s, and acquiring a subscript1 or 2. I also define 12 = 2 1, the increase of alongAB, with 12, s12, and 12 defined similarly. Equation (9) isClairauts characteristic equation for the geodesic, Eq. (A2).The ellipsoidal quantities s and are then given by (Bessel,1825, Eqs. (5))

    1

    a

    ds

    d=

    d

    d= w. (19)

    where w, Eq. (7), is now given in terms of byw =

    1 e2 cos2 , (20)

    and where the derivatives are taken holding 0 fixed (see Ap-pendix A). Integrating the equation for s and substituting for from Eq. (15) gives (Bessel, 1825, 5)

    s

    b=

    0

    1 + k2 sin2 d, (21)

    where

    k = e cos0. (22)As Legendre (1811, 127) points out, the expression for sgiven by Eq. (21) is the same as that for the length along theperimeter of an ellipse with semi-axes b and b

    1 + k2. The

    equation for may also be expressed as an integral in byusing the second of Eqs. (A4), d/d = sin/ cos; thisgives (Bessel, 1825, 9)

    = f sin0 0

    2 f1 + (1 f)

    1 + k2 sin2

    d.

    (23)Consider a geodesic on the auxiliary sphere completely encir-cling the sphere. On the ellipsoid, the end point B satisfies2 = 1 and 2 = 1; however, from Eq. (23), the longitudedifference 12 falls short of 2 by approximately 2f sin0.As a consequence, geodesics on ellipsoids (as distinct fromspheres) are not, in general, closed.

    In principle, the auxiliary sphere and Eqs. (21) and (23)enable the solution of all geodesic problems on an ellipsoid.However, the efficient solution of the inverse problem requiresknowledge of how neighboring geodesics behave. This is ex-amined in the next section.

    3. REDUCED LENGTH

    Following Bessels paper, Gauss (1902) studied the prop-erties of geodesics on general surfaces. Consider all the geo-desics emanating from a point A. Define a geodesic circle

    FIG. 3 Geodesics from a point 1 = 30. The east-going geo-desics with azimuths 1 which are multiples of 10 are shown asheavy lines. The spherical arc length of the geodesics is 12 = 180.The geodesics are viewed from a distant point over the equator at1 = 90. The light lines show equally spaced geodesic circles.The flattening of the ellipsoid was taken to be f = 1

    5for the purposes

    of this figure.

    centered at A to be the locus of points a fixed (geodesic) dis-tance s12 from A; this is a straightforward extension of thedefinition of a circle on a plane. Gauss (1902, 15) provedthat geodesic circles intersect the geodesics at right angles;see Fig. 3.

    (Circles on a plane also have a second property: they are thecurves which enclose the maximum area for a given perimeter.On an ellipsoid such curves have constant geodesic curvature(Minding, 1830). Darboux (1894, 652) adopts this as hisdefinition of the geodesic circle; however, in general, thesecurves are different from the geodesic circles as defined in theprevious paragraph.)

    Gauss (1902) also introduced the concept of the reducedlength m12 for the geodesic which is also the subject of adetailed investigation by Christoffel (1910) (the term is hiscoinage). Consider two geodesics of length s12 departingfromA at azimuths 1 and 1+d1. On a flat surface the endpoints are separated by s12 d1 (in the limit d1 0). Ona curved surface the separation is m12 d1 where m12 is thereduced length. Gauss (1902, 19) showed that the reducedlength satisfies the differential equation

    d2m

    ds2+K(s)m = 0, (24)

    where K(s) is the Gaussian curvature of the surface. Letm(s; s1) be the solution to Eq. (24) subject to the initial con-ditions

    m(s1; s1) = 0,dm(s; s1)

    ds

    s=s1

    = 1;

    then m12 is given by m12 = m(s2; s1). Equation (24) obeysa simple reciprocity relation m(s1; s2) = m(s2; s1) which

  • 4gives the result (Christoffel, 1910, 9) that the reduced lengthis invariant under interchange of the end points, i.e., m21 =m12.

    For a geodesic on an ellipsoid of revolution, the Gaussiancurvature is given by

    K =1

    =

    b2

    a4w4=

    1

    b2(1 + k2 sin2 )2. (25)

    Helmert (1880, 6.5) solves Eq. (24) in this case to givem12/b =

    1 + k2 sin2 2 cos1 sin2

    1 + k2 sin2 1 sin1 cos2

    cos1 cos2(J(2) J(1)

    ), (26)

    where

    J() =

    0

    k2 sin2 1 + k2 sin2

    d

    =s

    b 0

    11 + k2 sin2

    d. (27)

    In the spherical limit, Eq. (26) reduces tom12 = a sin12 = a sin(s12/a).

    Gauss (1902, 23) also introduced what I call the geode-sic scale M12, which gives the separation of close, initiallyparallel, geodesics, and which is given by another solution ofEq. (24), M(s; s1), with the initial conditions

    M(s1; s1) = 1,dM(s; s1)

    ds

    s=s1

    = 0.

    Darboux (1894, 633) shows how to construct the solutiongiven two independent solutions of Eq. (24) which are given,for example, by Eq. (26) with two different starting points.This gives

    M12 = cos1 cos2

    +

    1 + k2 sin2 21 + k2 sin2 1

    sin1 sin2

    sin1 cos2(J(2) J(1)

    )1 + k2 sin2 1

    , (28)

    where M12 = M(s2; s1). Note that M12 is not symmetricunder interchange of the end points. In the spherical limit,Eq. (28) reduces to

    M12 = cos12 = cos(s12/a).

    By direct differentiation, it is easy to show that the Wronskianfor the two solutions m12 and M12 is a constant. Substitutingthe initial conditions then gives

    M12dm12ds2

    m12 dM12ds2

    = 1. (29)

    There is little mention of the reduced length in the geodeticliterature in the English language of the last century. An ex-ception is Tobey (1928, Prop. IV) who derives an expressionfor m12 as a series valid for small s12/a (Rapp, 1991, 4.22).

    4. PROPERTIES OF THE INTEGRALS

    The solution of the main geodesic problems requires theevaluation of the three integrals appearing in Eqs. (21), (27),and (23). In order to approach the evaluation systematically, Iwrite these integrals as

    I1() =

    0

    1 + k2 sin2 d, (30)

    I2() =

    0

    11 + k2 sin2

    d, (31)

    I3() =

    0

    2 f1 + (1 f)

    1 + k2 sin2

    d. (32)

    In terms of Ij(), Eqs. (21), (27), and (23) becomes/b = I1(), (33)

    J() = I1() I2(), (34) = f sin0 I3(). (35)

    The integrals Ij() may be expressed in terms of ellipticfunctions as (Forsyth, 1896; Jacobi, 1855; Luther, 1856)

    I1() = k

    1

    u10

    nd2(u, k1) du, (36)

    I2() = k

    1u1, (37)

    I3() = (1 f)k1

    f sin2 0

    u10

    nd2(u, k1)

    1 + cot2 0 cd2(u, k1)

    du

    +tan1(sin0 tan)

    f sin0, (38)

    where k1 = k/1 + k2, k1 =

    1 k21 = 1/

    1 + k2,

    am(u1 K(k1), k1) = 12,cd(x, k) and nd(x, k) are Jacobian elliptic functions(Olver et al., 2010, 22.2), am(x, k) is Jacobis amplitudefunction (Olver et al., 2010, 22.16(i)), and K(k) is the com-plete elliptic integral of the first kind (Olver et al., 2010, 19.2(ii)). The integrals can also be written in closed form as(Legendre, 1811, 127128)

    I1() =1

    k1E( 12, k1) c1, (39)

    I2() = k

    1F ( 12, k1) c2, (40)I3() = 1 f

    fk1 sin2 0

    G( 12, cot2 0, k1)

    +tan1(sin0 tan)

    f sin0 c3, (41)

    where

    G(, 2, k) =

    0

    1 k2 sin2

    1 2 sin2 d

    =

    (1 k

    2

    2

    )(, 2, k) +

    k2

    2F (, k), (42)

  • 5the integration constants cj are given by the condition Ij(0) =0, and F (, k), E(, k), and (, 2, k) are Legendres in-complete elliptic integrals of the first, second, and third kinds(Olver et al., 2010, 19.2(ii)).

    There are several ways that the integrals may be com-puted. One possibility is merely to utilize standard algorithms(Bulirsch, 1965; Carlson, 1995) for elliptic functions and in-tegrals for the evaluation of Eqs. (39)(41). Alternatively,some authors, for example Saito (1970, 1979), have employednumerical quadrature on Eqs. (30) and (32). However, thepresence of small parameters in the integrals also allow theintegrals to be expressed in terms of rapidly converging se-ries. Bessel (1825) used this approach and tabulated the co-efficients appearing in these series thereby allowing the directgeodesic problem to be solved easily and with an accuracy ofabout 8 decimal digits. I also use this technique because itallows the integrals to be evaluated efficiently and accurately.

    Before carrying out the series expansions, it is useful to es-tablished general properties of the integrals. As functions of, the integrands are all even, periodic with period , posi-tive, and of the form 1 + O(f). (Note that k2 = O(f).) Theintegrals Ij() can therefore be expressed as

    Ij() = Aj( +Bj()

    ), for j = 1, 2, 3, (43)

    where the constant Aj = 1+O(f) and Bj() = O(f) is oddand periodic with period and so may be written as

    Bj() =

    l=1

    Cjl sin 2l, for j = 1, 2, 3. (44)

    In addition, it is easy to show that Cjl = O(f l). In order toobtain results for s, , and m12 accurate to order fL, truncatethe sum in Eq. (44) at l = L for j = 1 and 2 and at l =L 1 for j = 3. (In the equation for , Eq. (35), I3() ismultiplied by f ; so it is only necessary to compute this integralto order fL1.) Similarly, the expansions for Aj and Cjl maybe truncated at order fL for j = 1 and 2 and at order fL1for j = 3.

    The form of the trigonometric expansion, Eqs. (43) and(44), and the subsequent expansion of the coefficients as Tay-lor series in f (or an equivalent small parameter), that I de-tail in the next section, provide expansions for the integralswhich, with a modest number of terms, are valid for arbitrar-ily long geodesics. This is to be distinguished from a numberof approximate methods for short geodesics (Rapp, 1991, 6),which were derived as an aid to computing by hand.

    5. SERIES EXPANSIONS OF THE INTEGRALS

    Finding explicit expressions forAj andCjl is simply matterof expanding the integrands for small k and f enabling theintegrals to be evaluated. I used the algebra system Maxima(2009) to carry out the necessary expansion, integration, andsimplification. Here, I present the expansions to order L = 8.

    The choice of expansion parameter affects the compactnessof the resulting expressions. In the case of I1, Bessel intro-

    duced a change of variable,

    k2 =4

    (1 )2 , (45)

    =

    1 + k2 11 + k2 + 1

    =k2(

    1 + k2 + 1)2 , (46)

    into Eq. (30) to give

    (1 )I1() = 0

    1 2 cos 2 + 2 d. (47)

    The integrand now exhibits the symmetry that it is invariantunder the transformation and 12 . Thisresults in a series with half the number of terms (comparedto a simple expansion in k2). The relation between k and is the same as that between the second eccentricity and thirdflattening of an ellipsoid, e and n, and frequently formulas forellipsoids are simpler when expressed in terms of n because ofthe symmetry of its definition, Eq. (2). (Bessel undertook thetask of tabulating the coefficients in the series for B1() forsome 200 different values of k. This gave him with a strongincentive to find a way to halve the amount of work required.)

    The quantity is O(f); thus expanding Eq. (47) to order f8is, asymptotically, equivalent to expanding to order 8. Carry-ing out this expansion in then yields

    A1 = (1 )1(1 + 14

    2 + 1644 + 1256

    6 + 2516384 8 + ), (48)C11 = 12+ 3163 132 5

    + 192048 7 + ,C12 = 1162 + 1324 920486

    + 740968 + ,C13 = 1483 + 3256 5

    320487 + ,C14 = 55124 + 3512 6

    1116384 8 + ,C15 = 712805

    + 720487 + ,C16 = 720486

    + 940968 + ,C17 =

    33143367 + ,C18 =

    4292621448 + . (49)I use the caesura symbol,

    , to indicate where the series may

    be truncated, at O(f6), while still giving full accuracy withdouble-precision arithmetic for |f | 1/150 (this is estab-lished in Sect. 9). Equation (49) is a simple extension of se-ries given by Bessel (1825, 5), except that I have dividedout the coefficient of the linear term A1. Bessels formula-tion was used throughout the 19th century and the series givenhere, truncated to order 4, coincides with Helmert (1880,Eq. (5.5.7)). However, many later works, such as Rainsford(1955, Eqs. (18)(19)), use less efficient expansions in k2.

    The expansion for I2 proceeds analogously yielding

    A2 = (1 )(1 + 14

    2 + 9644 + 25256

    6 + 1225163848 + ), (50)C21 =

    12 +

    116

    3 + 1325 + 4120487 + ,

    C22 =316

    2 + 1324 + 352048

    6 + 474096 8 + ,

  • 6C23 =548

    3 + 52565 + 2320487 + ,

    C24 =35512

    4 + 7512 6 + 13316384 8 + ,

    C25 =63

    12805 + 2120487 + ,

    C26 =77

    20486 + 3340968 + ,

    C27 = 429

    143367 + ,

    C28 = 6435

    2621448 + . (51)

    The expansion of I3 is more difficult because of the pres-ence of two parameters f and k; this presented a problem forBesselit was a practical impossibility for him to compilecomplete tables of coefficients with two dependencies. Later,when the flattening of the earth was known with some preci-sion, he might have contemplated compiling tables for a fewvalues of f . Instead, Bessel (1825, 8) employs a transforma-tion to move the dependence on the second parameter into ahigher order term which he then neglects. The magnitude ofthe neglected term is about 0.000 003 for geodesics stretch-ing half way around the WGS84 ellipsoid; this correspondsto an error in position of about 0.1mm. Although this is avery small error, there is no need to resort to such trickerynowadays because computers can evaluate the coefficients asneeded.

    Following Helmert (1880, Eq. (5.8.14)), I expand in n and, both of which are O(f), to give

    A3 = 1(12 12n

    ) ( 14 + 18n 38n2)2

    ( 116 + 316n+ 116n2 516n3)3 ( 364 + 132n + 532n2 + 5128n3 + )4 ( 3128 + 5128n+ 5256n2 + )5 ( 5256 + 151024n+ )6 2520487 + ,

    (52)C31 =

    (14 14n

    )+

    (18 18n2

    )2

    +(

    364 +

    364n 164n2

    564n3)3+(

    5128 +

    164n

    + 164n2 164n3 + )4+(

    3128

    + 11512n+ 3512n2 + )5 +( 211024 + 5512n+ )6 + 243163847 + ,C32 =

    (116 332n+ 132n2

    )2

    +(

    364 132n 364n2

    + 132n3)3+(

    3128 +

    1128n

    9256n2 3128n3 + )4+(

    5256

    + 1256n 1128n2 + )5 +( 272048 + 698192n+ )6 + 187163847 + ,C33 =

    (5

    192 364n+ 5192n2 1192n3)3

    +(

    3128 5192n

    164n2 + 5192n3 + )4+(

    7512

    1384n 773072n2 + )5 +( 3256 11024n+ )6 + 139163847 + ,C34 =

    (7

    512 7256n + 5256n2 71024n3 + )4

    +(

    7512

    5256n 72048n2 + )5 +( 91024 438192n+ )6 + 127163847 + ,

    C35 =(

    212560

    9512n+ 151024n2 + )5 +( 91024 151024n+ )6 + 99163847 + ,C36 =

    ( 112048 998192n+

    )6 + 9916384

    7 + ,C37 =

    429114688

    7 + . (53)

    I continue these expansions out to order f7, which is, as notedas the end of Sect. 4, consistent with expanding the other inte-grals to order f8. All the parenthetical terms in Eqs. (52) and(53) are functions of n only and so may be evaluated once fora given ellipsoid. Note that the coefficient of l is a terminat-ing polynomial of order l in n. This is a curious degeneracyof this integral when expressed in terms of n and . Rainsford(1955, Eqs. (10)(11)) writes k2 in Eq. (23) in terms of f andcos2 0 and gives a expansion for the integral in powers of f .This results in an expansion with more terms.

    The direct geodesic problem requires solving Eq. (21) for in terms of s. (There is a unique solution because ds/d > 0.)Equations (33) and (43), with j = 1, can be written as

    = +B1(), (54)where

    = s/(bA1), (55)which shows that finding as a function of s is equivalent toinverting Eq. (54). This may be accomplished using Lagrange(1869, 16) inversion, which gives

    = +B1(), (56)where

    Bj() =l=1

    (1)ll!

    dl1Bj()l

    dl1

    =

    .

    Carrying out these operations with Maxima (2009) gives

    Bj() =

    l=1

    Cjl sin 2l, (57)

    where

    C11 =12 9323 + 20515365

    4879737287 + ,C12 =

    516

    2 37964 + 13354096 6 86171368640 8 + ,

    C13 =2996

    3 751285 + 290140967 + ,

    C14 =5391536

    4 239125606 + 1082857737280 8 + ,

    C15 =34677680

    5 2822318432 7 + ,

    C16 =3808161440

    6 733437286720 8 + ,

    C17 = 459485

    516096 7 + ,

    C18 = 109167851

    82575360 8 + . (58)

    Legendre (1806, 13) makes a half-hearted attempt at in-verting Eq. (21) in terms of trigonometric functions of s/b(instead of s/(bA1)). Because the period is slightly differ-ent from , the result is a much more messy expansion than

  • 7given here. Oriani (1833) used Lagrange inversion to solvethe distance integral as a series in k2. Finally, Helmert (1880,Eq. (5.6.8)) carries out the inversion in terms of (as here)including terms to order 3.

    Most other authors invert Eq. (21) iteratively. Both Bessel(1825) and Vincenty (1975a) use the scheme given by the firstline of

    (i+1) = B1((i))

    = (i) +s/b I1((i))

    A1,

    with (0) = . This converges linearly and this is adequateto achieve accuracies on the order of 0.1mm. A superior it-erative solution is given by Newtons method which can bewritten as

    (i+1) = (i) +s/b I1((i))1 + k2 sin2 (i)

    ,

    which converges quadratically enabling the solution to fullmachine precision to be found in a few iterations. The sim-ple iterative scheme effectively replaces the denominator inthe fraction above by its mean value A1. By using the re-verted series, I solve for non-iteratively. This does incur thecost of evaluating the coefficients C1l; however, this cost canbe amortized if several points along the same geodesics arecomputed.

    I give the expansions for Aj , Cjl, and C1l to order f8above. However, these expansions are generated by Maxima(2009) with only a few dozen lines of code in about 4 sec-onds. The expansions can easily be extended to higher orderjust by changing one parameter in the Maxima code; this hasbeen tested by generating the series to order f30, which takesabout 13 minutes. Maxima is also used to generate the C++code for the expansions in GeographicLib. Treating Maximaas a preprocessor for the C++ compiler, the methods presentedhere can be considered to be of arbitrary order. In the currentGeographicLib implementation, the order of the expansion isa compile-time constant which can be set to any L 8. Asa practical matter, the series truncated at order f6 suffice togive close to full accuracy with double-precision arithmeticfor terrestrial ellipsoids.

    Although Oriani (1806) and Bessel (1825) give expressionsfor general terms in their expansions, most subsequent authorsare content to work out just a few terms. An exception isthe work of Levallois and Dupuy (1952) who formulate theproblem in terms of Wallis integrals where the general termin the series is given by a recursion relation, allowing the se-ries to be extended to arbitrary order at run-time (Levallois,1970, Chap. 5). Pittman (1986) independently derived a sim-ilar method. Unfortunately, Pittman uses as the variable ofintegration (instead of ); because the latitude does not changemonotonically along the geodesic, this choice leads to a lossof numerical accuracy and to technical problems in followinggeodesics through vertices (the positions of extrema of the lat-itude for the geodesic).

    Because of their widespread adoption, the expansions givenby Vincenty (1975a) are of special interest. He expresses

    the distance integral in terms of C11 and the longitude inte-gral in terms of 1 A3. This leads to rather compact serieswhen truncated at order f3. However, much of the simplic-ity disappears at the next higher order, at which point Vin-centys technique offers no particular advantage. Neverthe-less, his procedure does expose the symmetry between k and in I1() even though his original expansion was in k2. Be-latedly, Vincenty (1975a, addendum) discovered the economyof Bessels change of variable, Eq. (45), to obtain the sameexpansions for A1 and C11 as given here (truncated at order3). Incidentally, the key constraint that Vincenty worked un-der was that his programs should fit onto calculators, such asthe Wang 720 (Vincenty, 1975b, p. 10), which only had a fewkilobytes of memory; this precluded the use of higher-orderexpansions and allowed for only a simple (and failure prone)iterative solution of the inverse problem. Vincenty cast theseries in nested, i.e., Horner, form, in order to minimizeprogram size and register use; I also use the Horner schemefor evaluating the series because of its accuracy and speed.

    6. DIRECT PROBLEM

    The direct geodesic problem is to determine 2, 12, and2, given 1, 1 and s12; see Fig. 1. The solution startsby finding 1 using Eq. (8); next solve the spherical triangleNEA, to give 0, 1, and 1, by means of Eqs. (9), (14), and(10). With 0 known, the coefficients Aj , Cjl, and C1l maybe computed from the series in Sect. 5. These polynomials aremost easily computed using the Horner scheme and the Max-ima program accompanying GeographicLib creates the nec-essary code. The functions Bj() and B1(), Eqs. (44) and(57), may similarly be evaluated for a given using Clenshaw(1955) summation, wherein the truncated series,

    f(x) =

    Ll=1

    al sin lx,

    is computed by determining

    bl =

    {0, for l > L,al + 2bl+1 cosx bl+2, otherwise,

    (59)

    and by evaluating the sum as

    f(x) = b1 sinx.

    Now s1 and 1 can be determined using Eqs. (33), (35), and(43). Compute s2 = s1 + s12 and find 2 using Eqs. (55) and(56). Solve the spherical triangle NEB to give 2, 2, and 2using Eqs. (15), (12), and (10). Find 2 using Eq. (8) again.With 2 and 2 given, 2 can be found from Eq. (35) whichyields 12 = 2 1.

    Although the reduced length m12 is not needed to solve thedirect problem, it is nonetheless a useful quantity to compute.It is found using Eqs. (26), (34), (43), (44), (50), and (51). Informing I1()I2() in Eq. (34), I avoid the loss of precisionin the term proportional to by writing

    A1 A2 = (A1 1) (A2 1),

  • 8where A1 1, for example, is given, from Eq. (48), by

    A1 1 = (1 )1(+ 14

    2 + 1644 + ).

    The geodesic scales M12 and M21 may be found similarly,starting with Eq. (28). This completes the solution of the di-rect geodesic problem.

    If several points are required along a single geodesic, manyof the intermediate expressions above may be evaluated justonce; this includes all the quantities with a subscript 1, andthe coefficients Aj , Cjl, C1l. In this case the determination ofthe points entails just two Clenshaw summations and a littlespherical trigonometry. If it is only necessary to obtain pointswhich are approximately evenly spaced on the geodesic, re-place s12 in the specification of the direct problem with the arclength on the auxiliary sphere 12, in which case the conver-sion from to is avoided and only one Clenshaw summationis needed.

    For speed and accuracy, I avoid unnecessarily invokingtrigonometric and inverse trigonometric functions. Thus Iusually represent an angle by the pair the pair (sin , cos );however, I avoid the loss of accuracy that may ensue whencomputing cos0, for example, using

    1 sin2 0. Instead,

    after finding the sine of 0 using Eq. (9), I compute its cosinewith

    cos0 =cos2 + sin2 sin2 ;

    similarly, after finding sin with Eq. (15), I use

    cos =sin2 0 + cos

    2 0 cos2 .

    In this way, the angles near the 4 cardinal directions can berepresented accurately. In order to determine the quadrant ofangles correctly, I replace Eqs. (10), (12), and (14) by

    = ph(cos + i sin0 sin), (60) = ph(cos cos0 + i sin0), (61) = ph(cos cos + i sin), (62)

    where = ph(x + iy) is the phase of a complex num-ber (Olver et al., 2010, 1.9(i)), typically given by the libraryfunction atan2(y, x). Equations (60) and (61) become inde-terminate at the poles, where sin0 = cos = 0. However, Iensure that (and hence ) and are consistent with their in-terpretation for a latitude very close to the pole (i.e., cos is asmall positive quantity) and that the direction of the geodesicin three-dimensional space is correct. In some contexts, thesolution requires explicit use of the arc length instead of itssine or cosine, for example, in the term Aj in Eq. (43) andin determining from Eq. (56).

    Geodesics which encircle the earth multiple times can behandled by allowing s12 and 12 to be arbitrarily large. Fur-thermore, Eq. (60) allows to be followed around the circle insynchronism with ; this permits the longitude to be trackedcontinuously along the geodesic so that it increases by +360(resp. 360) with each circumnavigation of the earth in theeasterly (resp. westerly) direction.

    The solution for the direct geodesic problem presented hereis a straightforward extension to higher order of Helmertsmethod (Helmert, 1880, 5.9), which is largely based onBessel (1825). These authors, in common with many morerecent ones, express the difference of the trigonometric termswhich arise when the sums, Eq. (44), in Bj(2)Bj(1) areexpanded as

    sin 2l2 sin 2l1 = 2 cos(l(2 + 1)

    )sin l12.

    This substitution is needed to prevent errors in the evaluationof the terms on the left side of the equation causing large rel-ative errors in the difference when using low-precision arith-metic. However, the use of double-precision arithmetic ren-ders this precaution unnecessary (see Sect. 9); furthermore itsuse interferes with Clenshaw summation and prevents the ef-ficient evaluation of many points along a geodesic.

    7. BEHAVIOR NEAR THE ANTIPODAL POINT

    Despite the seeming equivalence of the direct and inversegeodesic problems when considered as exercises in ellipsoidaltrigonometry, the inverse problem is significantly more com-plex when transferred to the auxiliary sphere. The includedangle for the inverse problem on the ellipsoid is 12; however,the equivalent angle 12 on the sphere cannot be immediatelydetermined because the relation between and , Eq. (23),depends on the unknown angle 0. The normal approach,epitomized by Rainsford (1955) and Vincenty (1975a), is toestimate 1 and 2, for example, by approximating the el-lipsoid by a sphere (i.e., 12 = 12), obtain a corrected 12from Eq. (23) and to iterate until convergence. This procedurebreaks down if 1 and 2 depend very sensitively on 12, i.e.,for nearly antipodal points. Before tackling the inverse prob-lem, it is therefore useful to examine the behavior of geodesicsin this case.

    Consider two geodesics starting at A with azimuths 1 and1 + d1. On a closed surface, they will intersect at somedistance from A. The first such intersection is the conjugatepoint for the geodesic and it satisfies m12 = 0 (for s12 > 0).Jacobi (1891) showed that the geodesics no longer retain theproperty of being the shortest path beyond the conjugate point(Darboux, 1894, 623). For an ellipsoid with small flattening,the conjugate point is given by

    2 = 1 f cos2 1 cos3 1 +O(f2),2 = 1 + f cos1 sin3 1 +O(f2).

    The envelope of the geodesics leaving A is given by the lo-cus of the conjugate points and, in the case of an ellipsoid,this yields a four-point star called an astroid (Jacobi, 1891,Eqs. (16)(17)), whose equation in cartesian form is, aftersuitable scaling (see below),

    x2/3 + y2/3 = 1, (63)

    which is depicted in Fig. 4a; see also Jacobi (1891, Fig. 11)and Helmert (1880, 7.2). The angular extent of the astroid is,

  • 9179 179.5 18029.5

    30

    30.5(a)

    12 ()

    2 ()

    179 179.5 18029.5

    30

    30.5(b)

    12 ()

    2 ()

    FIG. 4 Geodesics in antipodal region. (a) The geodesics emanat-ing from a point 1 = 30 are shown close in the neighborhoodof the antipodal point at 2 = 30, 12 = 180. The azimuths1 are multiples of 5 between 0 and 180. The geodesics aregiven in an equidistant cylindrical projection with the scale set for2 = 30

    . The heavy lines are geodesics which satisfy the shortest

    distance property; the light lines are their continuation. The WGS84ellipsoid is used. (b) The geodesic circles on the same scale. Theheavy (resp. light) lines are for geodesics which have (resp. do nothave) are property of being shortest paths. The cusps on the circleslie on the geodesic envelope in (a).

    to lowest order, 2f cos2 1. Figure 4b shows the behavior ofthe geodesic circles in this region.

    Although geodesics are no longer the shortest paths beyondthe conjugate point (where they intersect a nearby geodesic),in general, they loose this property earlier when they first in-tersect any geodesic of the same length emanating from the

    same starting point. In the case of the ellipsoid, it is easy toestablish earlier intersection points. Consider two geodesicsleaving A with azimuths 1 and 1. These intersect at|12| = and 2 = 1 and, for oblate ellipsoids this in-tersection is earlier than the conjugate points. For prolate el-lipsoids the corresponding pair of azimuths are1 and theseintersect at |12| = , also prior to the conjugate points. Thus,an ellipsoidal geodesic is the shortest path if, and only if,

    max(|12| , |12|) .The only conjugate points lying on shortest paths are for thegeodesics with 1 = 12 for oblate ellipsoids and 1 = 0or for prolate ellipsoids. Solving the inverse problem withend points close to such conjugate pairs presents a challengebecause tiny changes in end points lead to large changes in thegeodesic.

    The inverse problem may be solved approximately in thecase of nearly antipodal points by considering the point B to-gether with envelope of geodesics for A (centered at the an-tipodes of A); see Fig. 5. The coordinates near the antipodescan be rescaled as

    x =sin( 1 )

    , y =

    sin( + 1)

    ,

    where

    = fA3 cos1, = cos1,

    and A3 is evaluated with 0 = 12 |1|. In the (x, y) coor-dinate system, the conjugate point for the geodesic leaving Awith 1 = 12 is at (1, 0) and the scale in the y directioncompared to x is 1+O(f). The geodesic throughB is tangentto the astroid; plane geometry can therefore be used to find itsdirection, using

    x

    cos y

    sin + 1 = 0, (64)

    where = 12 2 1 12 is the angle of the geodesicmeasured anticlockwise from the x axis. The constant termon the left hand side of Eq. (64), 1, reflects the property oftangents to the astroid, that the length CD is constant. (Theastroid is the envelope generated as a ladder slides down awall.) Note that geodesics are directed lines; thus a distinctline is given by + . The point of tangency of Eq. (64)with the astroid is

    x0 = cos3 , y0 = sin3 ,which are the parametric equations for the astroid, Eq. (63);the line and the astroid are shown in Fig. 5a. The goal nowis, given x and y (the position of B), to solve Eq. (64) for .I follow the method given by Vermeille (2002) for convertingfrom geocentric to geodetic coordinates. In Fig. 5b,COD andBED are similar triangles; if the (signed) length BC is ,then an equation for can be found by applying Pythagorastheorem to COD,

    x2

    (1 + )2+y2

    2= 1,

  • 10

    1

    2

    Q2

    3

    Q34

    x

    y

    O

    1

    1C

    B

    D(a)

    OC

    B E

    D(b)

    1y/

    yx/(1+)

    x

    FIG. 5 The inverse geodesic problem for nearly antipodal points.(a) The heavy line (labeled 1) shows the shortest geodesic from Ato B continued until it intersects the antipodal meridian at D. Thelight lines (24) show 3 other approximately hemispherical geode-sics. The geodesics are all tangent (at their points of conjugacy) tothe astroid in this figure. The points Q2 and Q3 are the points ofconjugacy for the geodesics 2 and 3. (b) The solution of the astroidequations by similar triangles.

    which can be expanded to give a quartic equation in ,

    4 + 23 + (1 x2 y2)2 2y2 y2 = 0. (65)Once is known, can be determined from the triangleCODin Fig. 5b,

    = ph(x/(1 + ) iy/). (66)

    The point C in Fig. 5 corresponds to a spherical longitudedifference of . Thus the spherical longitude difference forB,12, can be estimated as

    12 + x1 +

    ; (67)

    compare with Helmert (1880, Eq. (7.3.11)).In Appendix B, I summarize the closed form solution of

    Eq. (65) as given by Vermeille (2002). I have modified this

    TABLE 1 The four approximately hemispherical solutions of theinverse geodesic problem on the WGS84 ellipsoid for 1 = 30,2 = 29.9

    , 12 = 179.8

    , ranked by length s12.

    No. 1 () 2 () s12 (m) 12 () m12 (m)

    1 161.891 18.091 19 989 833 179.895 57 2772 30.945 149.089 20 010 185 180.116 24 241

    3 68.152 111.990 20 011 887 180.267 22 6494 81.076 99.282 20 049 364 180.631 68 796

    solution so that it is applicable for all x and y and more stablenumerically.

    Equation (65) has 2 (resp. 4) real roots if B lies outside(resp. inside) the astroid. The methods given in Appendix B(with e set to unity) can be used to determine all these roots,, and Eq. (66) then gives the corresponding angles of thegeodesics at B. All the geodesics obtained in this way are ap-proximately hemispherical and that obtained using the largestvalue of is the shortest path. If B lies on the axes within theastroid, then the limiting solutions Eqs. (B6) or (B7) shouldbe used to avoid an indeterminate expression. For example, ify = 0, substitute the largest from Eq. (B7) into Eq. (66) togive = ph

    (x+ imax(0, 1 x2)).Figure 5 shows a case where B is within the astroid result-

    ing in 4 hemispherical geodesics which are listed in Table 1ranked by their length. The values given here have been accu-rately computed for the case of the WGS84 ellipsoid using themethod described in Sect. 8. The second and third geodesicsare eastward (the same sense as the shortest geodesic), whilethe last is westward. As B crosses the boundary of the astroidthe second and third geodesics approach one another and dis-appear (leaving the first and fourth geodesics). Figure 5a alsoillustrates that the envelope is an evolute of the geodesics; inparticular, Eisenhart (1909, 94) shows that the length of geo-desic 2 from A to its conjugate point Q2 exceeds the length ofgeodesic 3 from A to Q3 by the distance along the envelopefrom Q3 to Q2; see also Helmert (1880, 9.2).

    Schmidt (2000) uses Helmerts method for estimating theazimuth. Bowring (1996) proposed a solution of the astroidproblem where he approximates the 4 arcs of the astroid byquarter circles. Rapp (1993, Table 1.6, p. 54) gives a simi-lar set of hemispherical geodesics to those given in Table 1.However, this table contains two misprints: 2 should be400105.759 32 and not 400005.759 32; for method3, 12 should be 862038.153 06 and not 872038.153 06.

    8. INVERSE PROBLEM

    Recall that the inverse geodesic problem is to determines12, 1 and 2 given 1, 2, and 12. I begin by review-ing the solution of the inverse problem assuming that 12 isgiven (which is equivalent to seeking the solution of the in-verse problem for a sphere). Write the cartesian coordinatesfor the two end points on the auxiliary sphere (with unit ra-

  • 11

    dius) as A = [cos1, 0, sin1] and B = [cos2 cos12,cos2 sin12, sin2]. A point on the geodesic a small spher-ical arc length d from A is at position A+dA where dA =[ sin1 cos1, sin1, cos1 cos1] d. The azimuth 1can be found by demanding that A, B, and dA be coplanaror that AB and A dA be parallel (where here denotesthe vector cross product), and similarly for 2. Likewise, thespherical arc length 12 is given by ph(A B + i |AB|),where denotes the vector dot product. Evaluating these ex-pressions gives

    z1 = cos1 sin2 sin1 cos2 cos12+ i cos2 sin12,

    z2 = sin1 cos2 + cos1 sin2 cos12+ i cos1 sin12,

    1 = ph z1, (68)2 = ph z2, (69)12 = ph(sin1 sin2 + cos1 cos2 cos12 + i |z1|).

    (70)In order to maintain accuracy when A and B are nearly coin-cident or nearly antipodal, I evaluate the real part of z1 as

    sin(2 1) sin2 12 sin1 cos21 cos12 ,

    where the upper and lower signs are for cos12 0. Theevaluation of z2 is handled in the same way. This completesthe solution of the inverse problem for a sphere.

    In the ellipsoidal case, the inverse problem is just a two-dimensional root finding problem. Solve the direct geodesicstarting at A and adjust 1 and s12 (subject to the shortestdistance constraint), so that the terminal point of the geodesicmatches B. In order to convert this process into an algorithm,a rule needs to be given for adjusting 1 and 12 so that theprocess converges to the true solution.

    The first step in finding such a rule is to convert the two-dimensional problem into a one-dimensional root-finding one.I begin by putting the points in a canonical configuration,

    1 0, 1 2 1, 0 12 . (71)This may be accomplished swapping the end points and thesigns of the coordinates if necessary, and the solution maysimilarly be transformed to apply to the original points. Re-ferring to Fig. 3, note that, with these orderings of the coor-dinates, all geodesics with 1 [0, ] intersect latitude 2with 12 [0, ]. Furthermore, the search for solutions canbe restricted to 2 [0, 12], i.e., when the geodesic first in-tersects latitude 2. (For 2 = 1, there is a second shortestpath with 2 [ 12, ] if 12 is nearly equal to . But thisgeodesic is easily derived from the first.)

    Meridional geodesics are treated as a special case. Theseinclude the cases 12 = 0 or and 1 = 12 with any 12.This also includes the case where A and B are coincident. Inthese cases, set 1 = 12 and 2 = 0. (This value of 1 isconsistent with the prescription for azimuths near a pole givenat the end of Sect. 6.)

    0 45 90 135 1800

    45

    90

    135

    180

    1 ()

    12

    ()

    2 = 3025

    150

    152530

    FIG. 6 The variation of 12 as a function of 1. The latitudes are1 = 30 and 2 = 30, 25, 15, 0, 15, 25, 30. For1 < 0 and 1 < 2 < 1, the curves are strictly increasing,while for 1 < 0 and 2 = 1, the curves are non-decreasing withdiscontinuities in the slopes at 1 = 90 (see Fig. 7). The WGS84ellipsoid is used.

    Define now a variant of the direct geodesic problem: given1, 2, subject to Eq. (71), and 1, find 12. Proceed as in thedirect problem up to the solution of the triangle NEA. Find2 from Eq. (8) and solve the triangle NEB for 2 [0, 12],2, 2 from Eqs. (9), (14), and (10). Finally, determine 12 asin the solution to the direct problem. In determining 2 fromEq. (9), I use in addition

    cos2 =+cos2 1 cos2 1 + (cos2 2 cos2 1)

    cos2, (72)

    where the parenthetical term under the radical is computedby (cos2 cos1)(cos2 + cos1) if 1 < 14 and by(sin1 sin2)(sin1 + sin2) otherwise. It remains todetermine the value of 1 that results in the given value of12.

    I show the behavior of 12 as a function of 1 in Figs. 67. For an oblate ellipsoid and |2| < 1, 12 is a strictlyincreasing function of 1. For 2 = 1, 12 vanishes for 0 1 100 and

    x > 1 1000.

    boundaries of the regions). (1) Short lines: If 12 and 21are reasonably small, then use 12 12/w1, where w1 isgiven by Eq. (20). (2) Intermediate lines: Assume 12 = 12,provided that the resulting 12 is sufficiently less than .(3) Long lines: Analyze the problem using the methods ofSect. 7, evaluate x < 0 and y 0, and use Eq. (67) as anestimate of 12. However, if y is very small and 1 x 0,then 12 is nearly equal to and Eq. (68) becomes indeter-minate; in this case, estimate 1 directly using 1 + 12,with given by Eq. (66) (region 3b in Fig. 9). This rule is alsoapplied for x slightly less than 1, to ensure that Newtonsmethod doesnt get tripped by the discontinuity in the slope of12(1) in Fig. 7b.

    This provides suitable starting values for1 for use in New-tons method. Carrying out Newtons method can be avoidedin case 1 above if 12, Eq. (70), is sufficiently small (case 1a inFig. 9), in which case the full solution is given by Eqs. (68)(70) with s12 = aw112. This also avoids the problem ofmaintaining accuracy when solving for 12 given 2 1and 1 12. Details of the convergence of Newtons method

  • 13

    are given in Sect. 9. The boundaries of regions 1a and 3b inFig. 9 depend on the precision of the floating-point numbersystem. This is characterized by = 1/2p1 where p is thenumber of bits of precision in the number system and 1 + is the smallest representable number greater than 1. Typicallyp = 53 and = 2.2 1016 for double precision.

    Once a converged value of 1 has been found, convergedvalues of 2, 1, and 2 are also known (during the courseof the final Newton iteration), and s12 can be found usingEq. (33). The quantities m12, M12, and M21 can also be com-puted as in the solution of the direct problem. This completesthe solution of the inverse problem for an ellipsoid.

    In the following cases, there are multiple solutions to theinverse problem and I indicate how to find them all given onesolution. (1) If 1 + 1 = 0 (and neither point is at the pole)and if 1 6= 2, a second geodesic is obtained by setting 1 =2 and 2 = 1. (This occurs when 12 180 for oblateellipsoids.) (2) If 12 = 180 (and neither point is at a pole)and if the geodesic in not meridional, a second geodesic isobtained by setting 1 = 1 and 2 = 2. (This occurswhen the 1 + 2 0 for prolate ellipsoids.) (3) If A andB are at opposite poles, there are infinitely many geodesicswhich can be generated by setting1 = 1+ and 2 = 2 for arbitrary . (For spheres, this prescription applies whenA and B are antipodal.) (4) If s12 = 0 (coincident points),there are infinitely many geodesics which can be generated bysetting 1 = 1 + and 2 = 2 + for arbitrary .

    The methods given here can be adapted to return geodesicswhich are not shortest paths provided a suitable starting pointfor Newtons method is given. For example, geodesics 24 inTable 1 can be found by using the negative square root in theequation for cos2, Eq. (72); and for geodesic 4, solve theproblem with 212 = 180.2 as the longitude difference.In these cases, the starting points are given by the multiple so-lutions of the astroid equation, Eq. (65). Geodesics that wraparound the globe multiple times can be handled similarly.

    Although the published inverse method of Vincenty(1975a) fails to converge for nearly antipodal points, he didgive a modification of his method that deals with this case(Vincenty, 1975b). The method requires one minor modifica-tion: following his Eq. (10), insert cos =

    1 sin2 .

    The principal drawback of his method (apart from the lim-ited accuracy of his series) is its very slow convergence fornearly conjugate pointsin some cases, many thousands of it-erations are required. In contrast, by using Newtons method,the method described here converges in only a few iterations.Sodano (1958), starting with the same formulation as givenhere (Bessel, 1825; Helmert, 1880) derives an approximatenon-iterative solution for the inverse problem; however, thismay fail for antipodal points (Rapp, 1993, 1.3). Sodanosjustification for his method is illuminating: a non-iterativemethod is better suited to the mechanical and electronic com-puters of his day. (See also my comment about Vincentysuse of programmable calculators at the end of Sect. 5.) Thesituation now is, of course, completely different: the series ofBessel and Helmert are readily implemented on modern com-puters and iterative methods are frequently key to efficient andaccurate computational algorithms.

    TABLE 2 Truncation errors for the main geodesic problems. dand i are approximate upper bounds on the truncation errors forthe direct and inverse problems. The parameters of the WGS84and the SRMmax ellipsoids are used. The SRMmax ellipsoid, a =6400 km, f = 1/150, is an ellipsoid with an exaggerated flatten-ing introduced by the National Geospatial-Intelligence Agency forthe purposes of algorithm testing.

    WGS84 SRMmaxL d (m) i (m) d (m) i (m)

    2 2.6 102 2.6 102 2.1 101 2.1 1013 3.7 105 1.6 105 5.8 104 2.5 1044 1.1 107 3.2 108 3.3 106 1.0 1065 2.5 1010 2.3 1011 1.6 108 1.5 1096 7.7 1013 5.3 1014 9.6 1011 6.6 10127 2.1 1015 4.1 1017 5.2 1013 1.0 10148 6.8 1018 1.1 1019 3.4 1015 5.0 10179 2.0 1020 8.0 1023 2.0 1017 7.9 102010 6.6 1023 2.1 1025 1.3 1019 4.1 102212 6.7 1028 4.6 1031 5.2 1024 3.6 102714 7.0 1033 1.1 1036 2.2 1028 3.3 103216 7.7 1038 2.5 1042 9.4 1033 3.0 103718 8.5 1043 5.8 1048 4.2 1037 2.8 104220 9.7 1048 1.4 1053 1.9 1041 2.7 1047

    9. ERRORS

    Floating-point implementations of the algorithms describedin Secs. 6 and 8 are included in GeographicLib (Karney,2010). These suffer from two sources of error: truncationerrors because the series in Sect. 5, when truncated at or-der L, differ from the exact integrals; and round-off errorsdue to evaluating the series and solving the resulting problemin spherical trigonometry using inexact (floating-point) arith-metic. In order to assess both types of error, it is useful to beable to compute geodesics with arbitrary accuracy. For thispurpose, I used Maximas Taylor package to expand the se-ries to 30th order and its bigfloat package to solve the directproblem with 100 decimal digits. The results obtained in thisway are accurate to at least 50 decimal digits and may be re-garded as exact.

    I first present the truncation errors. I carry out a sequenceof direct geodesic computations with random 1, 1, and s12(subject to the shortest path constraint) comparing the posi-tion of the end point (2 and 12) computed using the seriestruncated to order L with the exact result (i.e., with L = 30),in both cases using arithmetic with 100 decimal digits. Theresults are shown in Table 2 which shows the approximatemaximum truncation error as a function of L 20. The quan-tity d gives the truncation error for the method as given inSect. 6; this scales as fL. On the other hand, i is the trunca-tion error where, instead of solving in terms of s using thetruncated reverted series, Eq. (56), I invert the truncated se-ries for s, Eqs. (33) and (43), to give in terms of s. (This isdone exactly, i.e., using Newtons method and demanding

  • 14

    convergence to 100 decimal places.) This is representative ofthe truncation error in the solution of inverse geodesic prob-lem, because the inverse problem does not involve determin-ing in terms of s. i scales approximately as (12f)

    L. For

    comparison, the truncation errors for Vincentys algorithm are9.1105m and 1.5103m for the WGS84 and SRMmaxellipsoids; these errors are about 2.5 times larger than d forL = 3 (the order of Vincentys series).

    I turn now to the measurement of the round-off errors.The limiting accuracy, assuming that the fraction of thefloating-point representation contains p = 53 bits, is about20 000 km/253 2 nm (where 20 000 km is approximatelyhalf the circumference of the earth). From Table 2, the choiceL = 6 ensures that the truncation error is negligible comparedto the round-off error even for f = 1/150. I assembled a largeset of exact geodesics for the WGS84 ellipsoid to serve as testdata. These were obtained by solving the direct problem usingMaxima using the protocol described at the beginning of thissection. All the test data satisfies 12 180, so that theyare all shortest paths. Each test geodesic gives accurate valuesfor 1, 1, 2, 12, s12, 12, and m12. In this list 1, 1,and s12 are input values for the direct problem. The othervalues are computed and then rounded to the nearest 0.1 pmin the case of m12 and (1018) in the case of the angles. Thetest data includes randomly chosen geodesics together witha large number of geodesics chosen to uncover potential nu-merical problems. These include nearly meridional geodesics,nearly equatorial ones, geodesics with one or both end pointsclose to a pole, and nearly antipodal geodesics.

    For each test geodesic, I use the floating-point implementa-tions of the algorithms to solve the direct problem from eachend point and to solve the inverse problem. Denoting the re-sults of the computations with an asterisk, I define the error ina computed quantity x by x = xx. For the direct problemcomputed starting at the first end point, I compute the error inthe computed position of the second end point as

    |22 + i cos222| .I convert the error in the azimuth into a distance via

    a |2 12 sin2| ,which is proportional to the error in the direction of the geo-desic at B in three dimensions and accounts for the couplingof 2 and 12 near the poles. I compute the correspondingerrors when solving the direct problem starting at the secondend point.

    For the inverse problem, I record the error in the length

    |s12| .I convert the errors in the azimuths into a length using

    max(|1| , |2|) |m12| ;the multiplication by the reduced length accounts for the sen-sitivity of the azimuths to the positions of the end points. Anobvious example of such sensitivity is when the two pointsare close to opposite poles or when they are very close to each

    TABLE 3 Two close geodesics. The parameters of the WGS84 el-lipsoid are used.

    Case 1 Case 2

    1 302 30

    (304 1015)

    12 179.477 019999 75666

    1 90.000 008 90.001 489

    2 89.999 992 89.998 511

    s12 19 978 693.309 037 086m

    12 180 180.000 000

    m12 1.1 nm 51m

    other. A less obvious case is illustrated in Table 3. The secondend points in cases 1 and 2 are only 0.4 nm apart; and yet theazimuths in the two cases differ by 5.3 and the two geo-desics are separated by about 160m at their midpoints. (Thisunstable case finding the conjugate point for a geodesic bysolving the direct problem with 1 = 90 and spherical arclength of 12 = 180.)

    This provides a suitable measure of the accuracy of thecomputed azimuths for the inverse problem. I also check theirconsistency. If s12 a, I determine the midpoint of the com-puted geodesic by separate direct geodesic calculations start-ing at either end point with the respective computed azimuthsand geodesic lengths 12s12 and I measure the distance be-tween the computed midpoints. Similarly for shorter geode-sics, s12 < a, I compare the computed positions of a pointon the geodesic a distance a beyond the second point withseparate direct calculations from the two endpoints and repeatsuch a comparison for a point a distance a before the first endpoint.

    In this way, all the various measures of the accuracy ofthe direct and inverse geodesic are converted into comparableground distances, and the maximum of these measures over alarge number of test geodesics is a good estimate of the com-bined truncation and round-off errors for the geodesic calcu-lations. The maximum error using double precision (p = 53)is about 15 nm. With extended precision (p = 64), the erroris about 7 pm, consistent with 11 bits of additional precision.The test data consists of geodesics which are shortest paths,the longest of which is about 20 000 km. If the direct problemis solved for longer geodesics (which are not therefore short-est paths), the error grows linearly with length. For example,the error in a geodesic of length 200 000 km that completelyencircles the earth 5 times is about 150 nm (for double preci-sion).

    Another important goal for the test set was to check the con-vergence of the inverse solution. Usually a practical conver-gence criterion for Newtons method is that the relative changein the solution is less than O(

    ); because of the quadratic

    convergence of the method, this ensures that the error in thesolution is less that O(). However, this reasoning breaksdown for the inverse geodesic problem because the deriva-

  • 15

    TABLE 4 Ellipsoidal trigonometry problems. Here, , , and arethe three given quantities. The notes column gives the number as-signed by Oriani (1810, p. 48) in his index of spheroidal problemsand by Puissant (1831, p. 521) in his enumeration of solutions. Seethe text for an explanation of the other columns.

    No. , , Ref. dd

    ,

    Notes

    1 1, 1, 2 1, 12 1, 1, 2 3, 123 1, 1, s12 12 Eq. (75) 5, 24 1, 1, 12 12 Eq. (76) 11, 65 1, 2, s12 1 1 Eq. (77) 7, 36 1, 2, 12 1 1 Eq. (78) 13, 77 1, 2, s12 1 2 Eq. (79) 8, 48 1, 2, 12 1 2 Eq. (80) 14, 89 1, s12, 12 1 3 Eq. (81) 19, 11

    10 1, s12, 12 1 3 Eq. (82) 17, 1011 1, 2, s12 1 2 Eq. (83) 10, 512 1, 2, 12 1 2 Eq. (84) 16, 9

    tive of 12 with respect to 1 can become arbitrarily small;therefore a more conservative convergence criterion is used.Typically 24 iterations of Newtons method are required. Asmall fraction of geodesics, those with nearly conjugate endpoints, require up to 16 iterations. No convergence failuresare observed.

    10. ELLIPSOIDAL TRIGONOMETRY

    The direct and inverse geodesic problems are two examplesof solving the ellipsoidal triangle NAB in Fig. 1 given twosides and the included angle. The sides of this triangle aregiven by NA = aE(12 1, e), NB = aE(12 2, e),and AB = s12 and its angles are NAB = 1, NBA = 2, and ANB = 12. The triangle is fully solved if 1, 1,2, 2, s12, and 12 are all known. The typical problem inellipsoidal trigonometry is to solve the triangle if just three ofthese quantities are specified. Considering that A and B areinterchangeable, there are 12 distinct such problems which arelaid out in Table 4. (In plane geometry, there are four distincttriangle problems. On a sphere, the constraint on the sumof the angles of a triangle is relaxed, leading to six triangleproblems.)

    Oriani (1810, p. 48) and Puissant (1831, p. 521) both gavesimilar catalogs of ellipsoidal problems as Table 4. Here (andin Sect. 11), I do not give the full solution of the ellipsoidalproblems nor do I consider how to distinguish the cases wherethere may be 0, 1, or 2 solutions. Instead, I indicate how, ineach case, an accurate solution may be obtained using New-tons method assuming that a sufficiently accurate startingguess has been found. This might be obtained by approximat-ing the ellipsoid by a sphere and using spherical trigonome-try (Todhunter, 1871, Chap. 6) or by using approximate ellip-

    soidal methods (Rapp, 1991, 6). In Sect. 13, I also show howthe gnomonic projection may be used to solve several ellip-soidal problems using plane geometry.

    In treating these problems, recall that the relation between and is given by Eq. (8) and depends only on the eccentric-ity of the ellipsoid. On the other hand, the relations betweens12 and 12 and the corresponding variables on the auxiliarysphere, 12 and 12, depend on the geodesic (specifically on0).

    In Table 4, , , are the given quantities. In problems 1and 2, the given quantities are all directly related to corre-sponding quantities for the triangle on the auxiliary sphere.This allows the auxiliary triangle to be solved and the ellip-soidal quantities can then be obtained. (Problem 1 was usedin solving the inverse problem in Sect. 8.)

    Problem 3 is the direct problem whose solution is givenin Sect. 6. Here, however, I give the solution by Newtonsmethod to put this problem on the same footing as the otherproblems. The solution consists of treating 12 (the col-umn labeled ) as a control variable. Assume a value forthis quantity, solve the problem with given 1, 1, 12 (i.e.,, , ) for s12 (i.e., ) using Eq. (33). The value thus foundfor s12 will, of course, differ from the given value and a betterapproximation for 12 is found using Newtons method with

    ds12d12

    1,1

    = aw2. (75)

    The equation for the derivative needed for Newtons method isgiven in the column labeled d/d|, in the table. Problem4 is handled similarly except that Eq. (35) is used to give 12and the necessary derivative for Newtons method is

    d12d12

    1,1

    =w2 sin2cos2

    . (76)

    Problems 14 are the simplest ellipsoidal trigonometryproblems with and specified at the same point, so that it ispossible to determine 0 which fixes the relation between s12and 12 and between 12 and 12. In the remaining problemsit is necessary to assume a value for 1 or 1 thereby reducingthe problem to one of the reference problems 13 (the columnlabeled Ref.). Thus, given , , , assume a value(0) for ;solve the reference problem , , (i) to determine (i); find amore accurate approximation to using

    (i+1) = (i) ((i) )(d(i)

    d(i)

    ,

    )1,

    and iterate until convergence. The remaining derivatives are

    ds12d1

    1,2

    = m12 tan2, (77)

    d12d1

    1,2

    =m12a

    1

    cos2 cos2, (78)

    ds12d1

    1,2

    = m12 tan2 aw2tan1 tan2 cos2

    , (79)

  • 16

    d12d1

    1,2

    =m12/a

    cos2 cos2 w2 tan2

    tan1 sin2, (80)

    d12d1

    1,s12

    =m12a

    cos2cos2

    , (81)

    d12d1

    1,s12

    =w31

    (1 f) sin1(cos1cos1

    cos2cos2

    N12

    ), (82)

    ds12d1

    1,2

    = aw31

    1 f(N12 tan2

    sin1

    +tan1

    cos2 tan2

    w2w1

    ), (83)

    d12d1

    1,2

    =w31

    1 f(

    cos1sin1 cos1

    N12 sec2sin1 cos2

    +tan1 tan2

    sin2

    w2w1

    ), (84)

    where

    N12 =M12 (m12/a) cos1 tan1w1

    .

    The choice of in these solutions is somewhat arbitrary;other choices may be preferable in some cases. These formu-las for the derivatives are obtained with constructions similarto Fig. 8. Equations (82)(84) involve partial derivatives takenwith 1 held constant; the role of N12 in these equation canbe contrasted with that of M12 as follows. Consider a geo-desic from A to B with length s12 and initial azimuth 1.Construct a second geodesic of the same length from A toB where A is given by moving a small distance dt from Ain a direction 1 + 12. If the initial direction of the secondgeodesic is 1 = 1 (resp. parallel to the first geodesic), thenthe distance from B to B is N12 dt (resp. M12 dt). (Becausemeridians converge, two neighboring geodesics with the sameazimuth are not, in general, parallel.)

    Problem 6 is the geodesic inverse problem solved in Sect. 8and I have repeated Eq. (73) as Eq. (78). Problem 7 is theretro-azimuthal problem for which Hinks (1929) gives aninteresting application. For many years a radio at Rugby trans-mitted a long wavelength time signal. Hinks retro-azimuthalproblem is to determine the position of an unknown point withknowledge of the distance and bearing to Rugby.

    11. TRIANGULATION FROM A BASELINE

    The ellipsoidal triangle considered in Sect. 10 is special inthat one of its vertices is a pole so that two of its sides aremeridians. The next class of ellipsoidal problems treated issolving a triangle ABC with a known baseline, see Fig. 10a.Here, the goal is to determine the position ofC if the positionsif A and B are known, i.e., if 1, 2, and 12 are given (andhence, from the solution of the inverse problem for AB, thequantities 1, 2, and s12 are known). This corresponds to a

    A A

    B

    B

    C C

    s13

    s23

    3

    y

    x

    (a) (b)

    FIG. 10 Two ellipsoidal triangle problems: (a) triangulating from abaseline and (b) rectangular geodesic (or oblique CassiniSoldner)coordinates.

    TABLE 5 Ellipsoidal triangulation problems. In these problems,the positions of A and B (i.e., 1, 2, and 12) are given and theposition of C is sought. The quantities and are the additionalgiven quantities.

    No. , dd

    0 1(3), s131 s13, s23 1(3) Eq. (85)2 1(3), 2(3) s13 Eq. (86)3 1(3), s23 s13 Eq. (87)4 s13, 3 1(3) Eq. (88)5 1(3), 3 s13 Eq. (89)

    class of triangulation problems encountered in field surveying:a line AB is measured and is used as the base of a triangula-tion network. However, in the present context, A need not bevisible from B and I consider both the problems of triangula-tion and trilateration. (In addition, remember that the anglesmeasured by a theodolite are not the angles between geodesicsbut between normal sections.)

    Because the problems entail consideration of more than asingle general geodesic, it is necessary to generalize the nota-tion for azimuthal angles to make clear which geodesic line isbeing measured. I define i(j) as the azimuth of the geodesicline passing through point i where j is some other point onthe same line. Each geodesic line is assigned a unique direc-tion, indicated by arrows in the figures, and all azimuths areforward azimuths (as before).

    With one side specified and two additional quantitiesneeded to solve the triangle, there are 10 possible problems tosolve. Of these, six are distinct (considering the interchange-ability of A and B) and are listed in Table 5. For the angleat C, I assume that 3 = 3(1) 3(2), the difference in thebearings of A and B, is given; this is included angle at C inFig. 10a. In other words, I do not presume that the directionof due north is known, a priori, at C. This is the commonsituation with theodolite readings and it also includes the im-portant case where is required to be 12 which allows the

  • 17

    shortest distance from a point to a geodesic to be determined.Problem 0 is just the direct geodesic problem (problem 3 of

    Sect. 10). The remaining 5 problems may be solved by New-tons method, in a similar fashion as in Sect. 10, as follows:replace the second given quantity by one of the unknowns;estimate a value of ; solve the problem with and (which,in each case, is a direct geodesic problem from A) to deter-mine a trial position forC; solve the inverse geodesic problembetween B and the trial position for C to obtain a trial valuefor ; update the value of using Newtons method so that theresulting value of matches the given value. The derivativesnecessary for Newtons method are given in Eqs. (85)(89):

    ds23d1(3)

    1,2,12,s13

    = m13 sin 3, (85)

    d2(3)

    ds13

    1,2,12,1(3)

    =1

    m23sin 3, (86)

    ds23ds13

    1,2,12,1(3)

    = cos 3, (87)

    d3d1(3)

    1,2,12,s13

    = M31 M32m13m23

    cos 3, (88)

    d3ds13

    1,2,12,1(3)

    =M32m23

    sin 3. (89)

    The triangulation problems 1, 2, and 3, entail specificationof either the distance or the bearing to C from each of A andB. These can also be solved by generalizing the method givenby Sjoberg (2002, 5) for the solution of problem 2. The tech-nique is to treat the latitude of C, 3, as the control variable.Thus, start with an estimate for 3; if the bearing of (resp. dis-tance to) C from a base point is given, then solve the inter-mediate problem i, 3, i(3) (resp. si3) where i = 1 or 2for base points A or B, i.e., problem 1 (resp. 5) in Sect. 10 togive i3; and evaluate 12 = 13 23. Now adjust 3 us-ing Newtons method so that the 12 matches the known valueusing

    di3d3

    i,i(3)

    =w33

    1 ftan3(i)

    cos3, (90)

    di3d3

    i,si3

    = w33

    1 fcot3(i)

    cos3. (91)

    This method of solution essentially factors the problem intotwo simpler problems of the type investigated in Sect. 10.

    A similar approach can also be applied to problem 5. Guessa value of s13, solve problems 3 and 1 of Sect. 10 to deter-mine successively the positions of C and B. Adjust s13 usingNewtons method so that the correct value of 12 is obtained,which requires the use of the derivative

    d12ds13

    1,2,1(3),3

    = M32a

    sin 3 sec2(3)

    cos2. (92)

    Knowledge of reduced length and the geodesic scale allowerrors to be propagated through a calculation. For example,

    if the measurements of 1(3) and 2(3) are subject to an in-strumental error , then the error ellipse in the position ofC when solving problem 2 will have a covariance which de-pends on m13 , m23 , and 3. The effects of errors in thepositions of A and B and in the measurements of s13 and s23can be similarly estimated.

    RNAV (2007, A2.4.13) also presents solution for prob-lems 13. However, these use the secant method and so con-verge more slowly that the methods given here.

    12. GEODESIC PROJECTIONS

    Several map projections are defined in terms of geodesics.In the azimuthal equidistant projection (Snyder, 1987, 25)the distance and bearing from a central point A to an arbitrarypoint B is preserved. Gauss (1902, 19) lays out the prob-lem for a general surface: the point B is projected to planecartesian coordinates,

    x = s12 sin1, y = s12 cos1.

    Bagratuni (1967, 16) calls these geodetic polar coordi-nates. Gauss (1902, 15) proves that the geodesics (lines ofconstant 1) and the geodesic circles (lines of constant s12),which, by construction, intersect at right angles in the projec-tion, also intersect at right angles on the ellipsoid (see Sect. 3).The scale in the radial direction is unity, while the scale inthe azimuthal direction is s12/m12; the projection is confor-mal only at the origin. The forward and reverse projectionsare given by solving the inverse and direct geodesic problems.The entire ellipsoid maps to an approximately elliptical area,with the azimuthal scale becoming infinite at the two bound-ary points on the x axis. The projection can be continuedbeyond the boundary giving geodesics which are no longershortest lines and negative azimuthal scales. Snyder (1987,p. 197) gives the formulas for this projection for the ellipsoidonly for the case where the center point is a pole. For example,if A is at the north pole then the projection becomes

    s12 = aE(12 2, e), m12 = a cos2.

    However, the method given here is applicable for any centerpoint. The projection is useful for showing distances and di-rections from a central transportation hub.

    Gauss (1902, 23) also describes another basic geode-sic projection, called right-angle spheroidal coordinates byBagratuni (1967, 17). Consider a reference geodesic passingthrough the point A at azimuth 1(3). The reverse projec-tion, B, of the point x, y is given by the following operationswhich are illustrated in Fig. 10b: resolve the coordinates intothe directions normal and parallel to the initial heading of thereference geodesic,

    x = cos1(3)x sin1(3)y,y = sin1(3)x+ cos1(3)y;

    starting at A proceed along the reference geodesic a dis-tance y to C; then proceed along the geodesic with azimuth

  • 18

    3(2) = 3(1) +12 a distance x

    to point B. (Here, the for-ward direction on the geodesic CB is to the right of the ref-erence geodesic AC which is the opposite of the conventionin Sect. 11.) Gauss (1902, 16) proves that geodesics (linesof constant y) and the geodesic parallels (lines of constantx) intersect at right angles on the ellipsoid. At B, the scalein the x direction is unity while the scale in the y directionis 1/M32 which is unity on x = 0; thus the projection is con-formal on x = 0. The definition of the mapping given hereprovides the prescription for carrying out the reverse projec-tions. The forward projection is solved as follows: determinethe point C on the reference geodesic which is closest to B(problem 5 of Sect. 11); set x to the distance CB signed pos-itive or negative according to whether B is to the right or leftof the reference geodesic; set y to the distance AC signedpositive or negative according to whetherC is ahead or behindA on the reference geodesic; finally transform the coordinateframe

    x = cos1(3)x + sin1(3)y

    ,

    y = sin1(3)x + cos1(3)y.In the case where the reference geodesic is the equator,the projection is the ellipsoidal generalization of the so-called equidistant cylindrical projection (Snyder, 1987,12). Solving for the point C is trivial; the coordinates aregiven by

    x = a12, y = a(E(e)E(122, e)

    ), M32 = cos2,

    where E(k) is the complete elliptic integral of thesecond kind (Olver et al., 2010, 19.2(ii)); see alsoBugayevskiy and Snyder (1995, 2.1.4). The whole ellipsoidis mapped to a rectangular region with the poles mapped tolines (where the scale in the x direction is infinite). If the refer-ence geodesic is a central meridian, the projection is calledCassiniSoldner (Snyder, 1987, 13) and C may most sim-ply be found by finding the midpoint of the geodesic BDwhere D is the reflection of B in the plane of the centralmeridian. This allows the CassiniSoldner mapping to be besolved accurately for the whole ellipsoid, in contrast to the se-ries method presented in Snyder (1987, p. 95) which is onlyvalid near the central meridian. The ellipsoid maps to an ap-proximately rectangular region with the scale in the y direc-tion divergent where the equator intersects the boundary. TheCassiniSoldner was widely used for large-scale maps untilthe middle of the 20th century when it was almost entirely re-placed by the transverse Mercator projection (Snyder, 1987,8). Tasks such as navigation and artillery aiming were muchmore easily accomplished with a conformal projection, suchas transverse Mercator, compared to CassiniSoldner with itsunequal scales. The general case of this mapping may betermed the oblique CassiniSoldner projection. Because thereference geodesic is not closed in this case, it is not conve-nient to use this projection for mapping the entire ellipsoidbecause there may be multiple candidates for C, the positionon the reference geodesic closest to B.

    The doubly equidistant projection has been used in small-scale maps to minimize the distortions of large land masses

    3u

    + = const.

    u

    = const.

    A

    B

    C

    1

    2

    s12

    s13

    s23

    FIG. 11 The doubly equidistant projection. Also shown are portionsof the geodesic ellipse and hyperbola through C.

    (Bugayevskiy and Snyder, 1995, 7.9). In this projection, thedistances to an arbitrary point C from two judiciously cho-sen reference points A and B are preserved; see Fig. 11. Theformulas are usually given for a sphere; however, the general-ization to an ellipsoid is straightforward. For the forward pro-jection, fix the baseline AB with A and B separated by s12;solve the inverse geodesic problems for AC and BC and usethe distances s13 and s23 together with elementary trigonome-try to determine the position of C in the projected space; thereare two solutions for the position of C either side of the base-line; the desired solution is the one that lies on the same sideof the baseline as C on the ellipsoid. The reverse projection issimilar, except that the position of C on the ellipsoid is deter-mined by solving problem 1 in Sect. 11. The projection is onlywell defined if 1 and 2 are the same sign (consistent with aplanar triangle). This is always the case for a sphere; the en-tire sphere projects onto an ellipse. However, on an ellipsoid,the geodesic connecting A and B is not closed in general andthus does not divide the ellipsoid into two halves. As a conse-quence, there may be a portion of the ellipsoid which is on oneside of the baseline geodesic as seen from A but on the otherside of it as seen fromB; such points cannot be projected. Forexample if A = (35N, 40E) and B = (35N, 140E), thenthe point (43.5S, 60.5W) cannot be projected because it isnorth of the baseline as seen by A but south of the baselinerelative to B

    The scales of the doubly equidistant projection can be de-termined as follows. By construction, geodesic ellipses andhyperbolae, defined by u = 12 (s13 s23) = const., mapto ellipses and hyperbolae under this projection; see Fig. 11.Weingarten (1863) establishes these results for geodesic el-lipses and hyperbolae (Eisenhart, 1909, 90): they are orthog-onal; the geodesic hyperbola through C bisects the angle 3made by the two geodesics from A and B; and the scales inthe u directions are cos 123 and sin

    123, respectively. The

    same relations hold, of course, for the projected ellipses andhyperbolae, except that the angle ACB takes on a different(smaller) value 3. Thus, the elliptic and hyperbolic scale fac-

  • 19

    A B

    C

    C

    1 12s12

    s13

    s23

    FIG. 12 The construction of the spheroidal gnomonic projection asthe limit of a doubly azimuthal projection.

    tors for the double equidistant projection may be written ascos 123

    cos 123

    ,sin 123

    sin 123

    ,

    respectively. Evaluating 3 using the cosine rule for the planetriangle ABC gives

    2s13s23 cos

    123

    (s13 + s23)2 s212,

    2s13s23 sin

    123

    s212 (s13 s23)2.

    The results generalize those of Cox (1946, 1951) for the pro-jection of a sphere. In the limit s12 0, this projection re-duces to the azimuthal equidistant projection and these scalesreduce to the radial scale, 1, and the azimuthal scale, s13/m13.

    13. SPHEROIDAL GNOMONIC PROJECTION

    The gnomonic projection of the sphere, which is obtainedby a central projection of the surface of the sphere onto a tan-gent plane, has the property that all geodesics on the spheremap to straight lines (Snyder, 1987, 22). Such a projectionis impossible for an ellipsoid because it does not have con-stant curvature (Beltrami, 1865). However, a spheroidal gen-eralization of the gnomonic projections can be constructed forwhich geodesics are very nearly straight. First recall that thedoubly azimuthal projection (Bugayevskiy and Snyder, 1995,7.8) of the sphere, where the bearings from two points A andB to C are preserved, gives the gnomonic projection which iscompressed in the direction parallel to AB. In the limit as Bapproaches A, the pure gnomonic projection is recovered.

    The construction of the spheroidal gnomonic projectionproceeds in the same way; see Fig. 12. Draw a geodesicBC such that it is parallel to the geodesic AC at B. Its ini-tial separation from AC is s12 sin 1; at C, the point clos-est to C, the separation becomes M13s12 sin 1 (in the limit

    s12 0). Thus the difference in the azimuths of the geode-sics BC and BC at B is (M13/m13)s12 sin 1, which gives1+2 = (M13/m13)s12 sin 1. Now, solving the planartriangle problem with 1 and 2 as the two base angles givesthe distance AC in the projected space as m13/M13.

    Thus leads to the following specification for the spheroidalgnomonic projection. Let the center point be A; for an arbi-trary point B, solve the inverse geodesic problem between Aand B; then point B projects to the point

    x = sin1, y = cos1, = m12/M12; (93)

    the projection is undefined if M12 0. In the spherical limit,this becomes the standard gnomonic projection, = a tan12(Snyder, 1987, p. 165). The azimuthal scale is 1/M12 and theradial scale, found by computing d/ds12 and using Eq. (29),is 1/M212; the projection is therefore conformal at the origin.The reverse projection is found by 1 = ph(y + ix) andby solving for s12 using Newtons method with d/ds12 =1/M212 (i.e., the radial scale). Clearly the projection preservesthe bearings from the center point and all lines through thecenter point are geodesics. Consider now a straight line BCin the projection and project this line on the spheroid. Thedistance that this deviates from a geodesic is, to lowest order,

    h =l2

    32(K t)t, (94)

    where l is the length of the geodesic,K is the Gaussian curva-ture, and t is the perpendicular vector from the center of pro-jection to the geodesic. I obtained this result semi-empirically:numerically, I determined that the maximum deviation wasfor east-west geodesics; I then found, by Taylor expansion,the deviation for the simple case in which the end points areequally distant from the center point at bearings ; finally,I generalized the resulting expression and confirmed this nu-merically. The deviation in the azimuths at the end points isabout 4h/l and the length is greater than the geodesic dis-tance by about 83h

    2/l. For an ellipsoid, the curvature is givenby Eq. (25), which gives

    K = 4ab4e2(1 e2 sin2 )5/2 cos sin; (95)

    the direction ofK is along the meridian towards the equator.Bounding h over all the geodesics whose end-points lie withina distance r of the center of projection, gives (in the limit thate and r are small)

    |h| f8

    r3

    a3r. (96)

    The limiting value is attained when the center of projectionis at = 45 and the geodesic is running in an east-westdirection with the end points at bearings45 or135 fromthe center.

    Bowring (1997) and Williams (1997) have proposed an al-ternate ellipsoidal generalization of the gnomonic projectionas a central projection of the ellipsoid onto a tangent plane. In

  • 20

    1000 km

    2000 km

    FIG. 13 The coast line of Europe and North Africa in the ellipsoidalgnomonic projection with center at (45N, 12E) near Venice. Thegraticule lines are shown at multiples of 10. The two circles arecentered on the projection center with (geodesic) radii of 1000 kmand 2000 km. The data for the coast lines is taken from GMT(Wessel and Smith, 2010) at low resolution.

    such a mapping, great ellipses project to straight lines. Em-pirically, I find that the deviation between straight lines in thismapping and geodesics is

    |h| f2

    r

    ar.

    Letovaltsev (1963) suggested another gnomonic projection inwhich normal sections through the center point map to straightlines. The corresponding deviation for geodesics is

    |h| 3f8

    r2

    a2r,

    which gives a more accurate approximation to geodesics thangreat ellipses. However, the new definition of the spheroidalgnomonic projection, Eq. (93), results in an even smaller er-ror, Eq. (96), in estimating geodesics. As an illustration, con-sider Fig. 13 in which a gnomonic projection of Europe isshown. The two circles are geodesic circles of radii 1000 kmand 2000 km. If the geodesic between two points within oneof these circles is estimated by using a straight line on thisfigure, the maximum deviation from the true geodesic will beabout 1.7m and 28m, respectively. The maximum changes inthe end azimuths are 1.1 and 8.6 and the maximum errorsin the lengths are only 5.4m and 730m.

    At one time, the gnomonic projection was useful for de-termining geodesics graphically. However, the ability to de-termine geodesics paths computationally renders such use ofthe projection an anachronism. Nevertheless, the projectioncan be a used within an algorithm to solve some triangulationproblems. For example, consider a variant of the triangula-tion problem 2 of Sect. 11: determine the point of intersectionof two geodesics between A and B and between C and D.

    This can be solved using the ellipsoidal gnomonic projectionas follows. Guess an intersection point O(0) and use this asthe center of the gnomonic projection; define a, b, c, d as thepositions of A, B, C, D in the gnomonic projection; find theintersection of of AB and CD in this projection, i.e.,

    o =(z c d)(b a) (z a b)(d c)

    z (b a) (d c) ,

    where indicates a unit vector (a = a/a) and z = x y isin the direction perpendicular to the projection plane. Projecto back to geographic coordinates O(1) and use this as a newcenter of projection; iterate this process until O(i) = O(i1)which is then the desired intersection point. This algorithmconverges to the exact intersection point because the mappingprojects all geodesics through the center point into straightlines. The convergence is rapid because projected geodesicswhich pass near the center point are very nearly straight. Prob-lem 5 of Sect. 11 can be solving using the gnomonic projec-tion in a similar manner. If the point O on AB which closestto C is to be found, the problem in the gnomonic space be-comes

    o =c (b a)(b a) (z a b)z (b a)

    |b a|2 ;

    in this case, the method relies on the preservation of azimuthsabout the center point.

    Another application of the gnomonic projection is in solv-ing for region intersections, unions, etc. For example the in-tersection of two polygons can be determined by projectingthe polygons to planar polygons with the gnomonic projec-tion about some suitable center. Any place were the edgesof the polygons intersect or nearly intersect in the projectedspace is a candidate for an intersection on the ellipsoid whichcan be found exactly using the techniques given above. Theinequality (96) can be used to define how close to intersec-tion the edges must be in projection space be ca