algorithms for geodesics

Upload: hammoudeh13

Post on 02-Jun-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Algorithms for Geodesics

    1/13

    J Geod (2013) 87:4355

    DOI 10.1007/s00190-012-0578-z

    ORIGINAL ARTICLE

    Algorithms for geodesics

    Charles F. F. Karney

    Received: 21 September 2011 / Accepted: 30 May 2012 / Published online: 26 June 2012 The Author(s) 2012. This article is published with open access at Springerlink.com

    Abstract Algorithms for the computation of geodesics on

    an ellipsoid of revolution are given. These provide accurate,robust, and fast solutions to the direct and inverse geodesicproblems and they allow differential and integral propertiesof geodesics to be computed.

    Keywords Geometrical geodesy Geodesics Polygonal areas Gnomonic projection Numerical methods

    1 Introduction

    The shortest path between two points on the earth, customar-ily treated as an ellipsoid of revolution, is called a geodesic.Two geodesic problems are usually considered: the directproblem of finding the end point of a geodesic given its start-ingpoint,initialazimuth,andlength;andthe inverse problemof finding the shortest path between two given points. Refer-ring to Fig. 1, it can be seen that each problem is equivalent tosolving the geodesic triangleN A Bgiven two sides and theirincluded angle (the azimuth at the first point, 1, in the caseof the direct problem and the longitude difference, 12, inthecase of theinverse problem).The frameworkfor solving theseproblems was laid down byLegendre(1806),Oriani(1806,1808,1810),Bessel(1825), andHelmert(1880). Based ontheseworks, Vincenty (1975a) devisedalgorithmsfor solvingthe geodesic problems suitable for early programmable deskcalculators; these algorithms are in widespread use today.A good summary of Vincentys algorithms and the earlierwork in the field is given byRapp(1993, Chap. 1).

    C. F. F. Karney (B)SRI International, 201 Washington Rd, Princeton,NJ 08543-5300, USAe-mail: [email protected]

    The goal of this paper is to adapt the geodesic methods of

    Helmert(1880) and his predecessors to modern computers.The current work goes beyond Vincenty in three ways: (1)The accuracy is increased to match the standard precisionof most computers. This is a relatively straightforward taskof retaining sufficient terms in the series expansions and canbe achieved at little computational cost. (2) A solution ofthe inverse problem is given which converges for all pairs ofpoints (Vincentys method fails to converge for nearly antip-odal points). (3) Differential and integral properties of thegeodesics are computed. The differential properties allowthe behavior of nearby geodesics to be determined, whichenables the scales of geodesic projections to be computed

    without resorting to numerical differentiation; crucially, oneof the differential quantities is also used in the solution of theinverseproblem. The integral propertiesprovide a method forfinding the area of a geodesic polygon, extending the workofDanielsen(1989).

    Section2reviews the classical solution of geodesic prob-lem by means of the auxiliary sphere and provides expan-sions of the resulting integrals accurate to O(f6)(where fis the flattening of the ellipsoid). These expansions can beinserted into the solution for the direct geodesic problempresented by, for example,Rapp(1993) to provide accuracyto machine precision. Section3gives the differential proper-

    ties of geodesics reviewing the results ofHelmert(1880) forthe reduced length and geodesic scale and give the key prop-erties of these quantities and appropriate series expansionsto allow them to be calculated accurately. Knowledge of thereduced length enables the solution of the inverse problemby Newtons method which is described in Sect.4. Newtonsmethod requires a good starting guess and, in the case ofnearly antipodal points, this is provided by an approximatesolution of the inverse problem byHelmert(1880), as givenin Sect.5. The computation of area between a geodesic and

    1 3

  • 8/10/2019 Algorithms for Geodesics

    2/13

    44 C. F. F. Karney

    s12

    0

    1

    2

    E

    A

    B

    FH

    N

    12

    1

    2

    Fig. 1 The ellipsoidal triangle N A B. Nis the north pole,N AFandN B Hare meridians, and A Bis a geodesic of length s12. The longitudeofB relative to A is12; the latitudes ofA and B are1and2. E F His the equator with Ealso lying on the extension of the geodesic AB ;and 0, 1, and 2 are the azimuths (in the forward direction) of thegeodesic at E,A, and B

    the equator is formulated in Sect.6,extending the work ofDanielsen(1989). Some details of the implementation and

    accuracy and timing data are presented in Sect. 7. As anillustration of the use of these algorithms, Sect.8 gives anellipsoidal gnomonic projection in which geodesics are verynearly straight. This provides a convenient way of solvingseveral geodesic problems.

    For the purposes of this paper, it is useful to generalizethe definition of a geodesic. The geodesic curvature, , of anarbitrary curve at a point P on a surface is defined as the cur-vature of the projection of the curve onto a plane tangent tothe surface at P . All shortest paths on a surface arestraight,defined as = 0 at every point on the path. In the rest ofthis paper, I use straightness as the defining property of geo-

    desics; this allows geodesic lines to be extended indefinitely(beyond the point at which they cease to be shortest paths).

    Several of the results reported here appeared earlier in atechnical report (Karney 2011).

    2 Basic equations and direct problem

    I consider an ellipsoid of revolution with equatorial radiusa,and polar semi-axisb, flattening f, third flatteningn, eccen-tricitye, and second eccentricityegiven by

    f= (a b)/a= 1

    1 e2, (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)

    As a consequence of the rotational symmetry of the ellipsoid,geodesics obey a relation found byClairaut(1735), namely

    sin 0= sin 1cos 1= sin 2cos 2, (5)

    (s)

    0

    E

    P

    G

    N

    ()

    ()

    Fig. 2 The elementary ellipsoidal triangleN E Pmapped to the auxil-iary sphere.N EandN P Gare meridians;E Gisthe equator; andE Pisthe great circle (i.e., the geodesic). The corresponding ellipsoidal vari-ables are shown inparentheses. Here P represents an arbitrary point onthe geodesic E AB in Fig.1

    where is the reduced latitude (sometimes called the para-metric latitude), given by

    tan = (1 f) tan . (6)The geodesic problems are most easily solved using anaux-iliary sphere which allows an exact correspondence to bemade between a geodesic and a great circle on a sphere. Onthe sphere, the latitude is replaced by the reduced lati-tude , and azimuthsare preserved. From Fig.2,it is clearthat Clairauts equation, sin 0= sin cos , is just the sinerule applied to the sides N Eand N P of the triangle N E Pand their opposite angles. The third side, the spherical arclength , and its opposite angle, the spherical longitude ,are related to the equivalent quantities on the ellipsoid, the

    distances , and longitude, by(Rapp 1993, Eqs. (1.28) and(1.170))

    s

    b=

    0

    1 + k2 sin2 d= I1(), (7)

    = fsin 0

    0

    2 f1 + (1 f)

    1 + k2 sin2

    d

    = fsin 0I3(), (8)

    where

    k= ecos 0. (9)See also Eqs. (5.4.9) and (5.8.8) ofHelmert(1880). The ori-gin for s , , , and is the point E, at which the geodesiccrosses the equator in the northward direction, with azimuth0. The point P can stand for either end of the geodesic ABin Fig.1, with the quantities,,,, s, and acquiring asubscript 1 or 2. I also define s12= s2 s1as the length ofAB, with12, 12, and12defined similarly. (In this paper,

    1 3

  • 8/10/2019 Algorithms for Geodesics

    3/13

    Algorithms for geodesics 45

    2is the forward azimuth at B . Several authors use the backazimuth instead; this is given by 2 .)

    Because Eqs. (7) and (8) depend on 0, the mappingbetween the ellipsoid and the auxiliary sphere is not a globalmapping of onesurface to another; ratherthe auxiliary sphereshould merely be regarded as a useful mathematical tech-nique for solving geodesic problems. Similarly, because the

    origin for depends on the geodesic, only longitude dif-ferences, e.g., 12, should be used in converting betweenlongitudes relative to the prime meridian and.

    In solving the spherical trigonometrical problems, the fol-lowing equations relating the sides and angles ofN E P areuseful:

    0= ph(|cos + isin sin | + isin cos ), (10)= ph(cos cos + isin ), (11)= ph(cos + isin 0sin ), (12)= ph(|cos 0cos + isin 0| + icos 0sin ), (13)= ph(cos 0cos + isin 0), (14)

    wherei = 1 and ph(x+ i y)is the phase of a complexnumber(Olver et al. 2010, 1.9.i), typically given by thelibrary function atan2(y,x). Equation (10) merely recastsEq. (5) in a form that allows it to be evaluated accuratelywhen0is close to

    12 . The other relations are obtained by

    applying Napiers rules of circular parts to N E P.Thedistanceintegral, Eq.(7),canbeexpandedinaFourier

    series

    I1

    ( )=

    A1+

    l=1

    C1l

    sin 2l , (15)with the coefficients determined by expanding the integral ina Taylor series. It is advantageousto follow Bessel(1825, 5)andHelmert(1880, Eq. (5.5.1)) and use , defined by

    =

    1 + k2 11 + k2 + 1

    or k= 2

    1 , (16)

    as the expansion parameter. This leads to expansions withhalf as many terms as the corresponding ones in k2. Theexpansion can be conveniently carried out to arbitrary orderby a computer algebra system such asMaxima(2009) which

    yields

    A1= (1 )1

    1 + 14 2 + 164 4 + 1256 6 +

    , (17)

    C11= 12 + 316 3 132 5 + ,C12= 116 2 + 132 4 92048 6 + ,C13= 148 3 + 3256 5 + ,C14= 5512 4 + 3512 6 + ,C15= 71280 5 + ,

    C16= 72048 6 + . (18)

    This extends Eq. (5.5.7) ofHelmert(1880) to higher order.These coefficients may be inserted into Eq. (1.40) ofRapp(1993) using

    Bj=

    A1, for j= 0,2A1C1l , for j= 2l, withl >0,

    (19)

    where here, and subsequently in Eqs. (22) and(26), a scriptletter, e.g., B, is used to stand for Rapps coefficients.

    In the course of solving the direct geodesic problem(where s12 is given), it is necessary to determine givens. Vincenty solves foriteratively. However, it is simpler tofollowHelmert(1880, 5.6) and substitute s = b A1 intoEqs. (7)and(15), to obtain = +lC1lsin 2l; thismaybe inverted, for example, using Lagrange reversion, to give

    =

    +

    l=1

    C1lsin 2l, (20)

    where

    C11= 12 932 3 + 2051536 5 + ,C12= 516 2 3796 4 + 13354096 6 + ,C13= 2996 3 75128 5 + ,C14= 5391536 4 23912560 6 + ,C15= 34677680 5 + ,C16= 3808161440 6 + . (21)

    This extends Eq. (5.6.8) ofHelmert(1880) to higher order.These coefficients may be used in Eq. (1.142) ofRapp (1993)using

    Dj= 2C1l , for j= 2l, withl >0. (22)Similarly, the integral appearing in the longitude equation,

    Eq. (8), can be written as a Fourier series

    I3( ) = A3

    +

    l=1C3lsin 2l

    . (23)

    FollowingHelmert(1880), I expand jointly inn and , both

    of which are O (f), to give

    A3= 1 1

    2 12 n

    14+ 18 n 38 n2

    2

    116+ 316 n + 116 n2

    3 364+ 132 n 4

    3128 5 + , (24)C31=

    14 14 n

    +

    18 18 n2

    2+

    364+ 364 n 164 n2

    3

    +

    5128+ 164 n

    4 + 3128 5 + ,

    1 3

  • 8/10/2019 Algorithms for Geodesics

    4/13

    46 C. F. F. Karney

    Table 1 The parameters for the WGS84 ellipsoid used in the exam-ples. The column labeled Eq. lists the equations used to compute thecorresponding quantities

    Qty. Value Eq.

    a 6 378 137 m Given

    f 1/ 298.257 223 563 Given

    b 6 356752.314245 m (1)c 6 371007.180918 m (60)

    n 0.00167922038638370 (2)

    e2 0.00669437999014132 (3)

    e2 0.00673949674227643 (4)

    C32=

    116 332 n + 132 n2

    2 +

    364 132 n 364 n2

    3

    + 3128+ 1128 n 4 + 5256 5 + ,C33=

    5192 364 n + 5192 n2

    3 +

    3128 5192 n

    4

    + 7512 5+ ,

    C34=

    7512 7256 n

    4 + 7512 5 + ,

    C35= 212560 5 + . (25)

    This extends Eq. (5.8.14) ofHelmert(1880) to higher order.These coefficients may be inserted into Eq. (1.56) ofRapp(1993) using

    Aj=

    A3, for j= 0,2A3C3l , for j= 2l, withl >0.

    (26)

    The equations given in this section allow the direct geo-

    desic problem to be solved. Given1(and hence1) and1solve the spherical triangleN E A to give 0, 1,and 1usingEqs.(10)(12). Finds1and 1from Eqs. (7)and (8)togetherwith Eqs.(15) and(23). (Recall that the origin foris EinFig. 1.) Determine s2= s1 +s12and hence 2using Eq. (20).Now solve the spherical triangle N E B to give 2, 2 (andhence2), and2, using Eqs. (12)(14). Finally, determine2(and 12) from Eqs.(8) and (23). A numerical example ofthe solution of the direct problem is given in Table 2usingthe parameters of Table1.

    3 Differential quantities

    Before turning to the inverse problem, I present Gauss solu-tion for the differential behavior of geodesics. One differen-tial quantity, the reduced length m12, is needed in the solutionof the inverse problem by Newtons method (Sect.4) and anexpression for this quantity is given at the end of this section.However, because this and other differential quantities aid inthe solution of many geodesic problems, I also discuss theirderivation and present some of their properties.

    Table 2 A sample direct calculation specified by1= 40, 1= 30,ands12= 10 000 km. For equatorial geodesics (1= 0 and 1= 12 ),Eq.(11)is indeterminate; in this case, take 1= 0Qty. Value Eq.

    1 40 Given1 30 Given

    s12 10 000 000 m GivenSolve triangle N E A

    1 39.90527714601 (6)0 22.55394020262 (10)1 43.99915364500 (11)1 20.32371827837 (12)

    Determine2

    k2 0.00574802962857 (9)

    0.00143289220416 (16)

    A1 1.00143546236207 (17)

    I1(1) 0.76831538886412 (15)

    s1 4 883990.626232 m (7)

    s2 14883 990.626 232 m s1+ s122 133.96266050208 s2/(b A1)2 133.92164083038 (20)Solve triangle N E B

    2 149.09016931807 (14)2 41.69771809250 (13)2 158.28412147112 (12)

    Determine12

    A3 0.99928424306 (24)

    I3(1) 0.76773786069 (23)

    I3(2) 2.33534322170 (23)

    1 20.26715038016 (8)2 158.11205042393 (8)12 137.84490004377 2 1Solution

    2 41.79331020506 (6)12 137.84490004377

    2 149.09016931807

    Consider a reference geodesic parametrized by distancesand a nearby geodesic separated from the reference by aninfinitesimal distance t(s). Gauss(1828) showed that t(s)satisfies the differential equation

    d2t(s)

    ds2 +K(s)t(s) = 0, (27)

    where K(s)is the Gaussian curvature of the surface. As asecond order, linear, homogeneous differential equation, itssolution can be written as

    t(s) = AtA(s) +B tB (s),

    1 3

  • 8/10/2019 Algorithms for Geodesics

    5/13

    Algorithms for geodesics 47

    d1 m

    12d

    1

    A B

    dt1 M

    12dt

    1A B

    A B

    AB

    (a)

    (b)

    (c)

    Fig. 3 The definitions of m12 and M12 are illustrated in a and b.A geometric proof of Eq.(29) is shown inc; hereA Band A Bare par-allel at B and B ,B A B= d1,B B= m12d1,A A= M21m12d1,and finally A BA= M21d1, from which Eq.(29) follows

    where Aand B are (infinitesimal) constants and tA andtBare independent solutions. When considering the geodesic

    segment spannings1 s s2, it is convenient to specify

    tA(s1) = 0,dtA(s)

    ds

    s=s1

    = 1,

    tB (s1) = 1,dtB (s)

    ds

    s=s1

    = 0,

    and to write

    m12= tA(s2), M12= tB (s2).The quantity m12 is the reduced length of the geodesic

    (Christoffel 1868). Consider two geodesics which cross at

    s= s1 at a small angle d1 (Fig.3a); at s = s2, they willbe separated by a distancem 12d1. Similarly I call M12thegeodesic scale. Consider two geodesics which are parallel ats= s1 and separated by a small distance dt1 (Fig.3b); ats= s2, they will be separated by a distance M12dt1.

    Several relations between m 12 and M12 follow from thedefining equation (27). The reduced length obeys a reciproc-ityrelation(Christoffel1868,9), m21+m12= 0;theWrons-kian is given by

    W(M12, m12)(s2) = M12dm12ds2

    m12dM12

    ds2= 1; (28)

    and the derivatives aredm12ds2

    = M21, (29)dM12

    ds2= 1 M12M21

    m12. (30)

    The constancy of the Wronskian follows by noting that itsderivative with respect to s2 vanishes; its value is found byevaluating it at s2= s1. A geometric proof of Eq. (29) isgiven in Fig.3c and Eq. (30) then follows from Eq. (28).

    With knowledge of the derivatives, addition rules for m12andM12are easily found:

    m13= m12M23 + m23M21, (31)M13= M12M23 (1 M12M21)

    m23

    m12, (32)

    M31= M32M21 (1 M23M32)m12

    m23 , (33)

    where points 1, 2, and 3 all lie on the same geodesic.Geodesics allow concepts from plane geometry to be gen-

    eralized to apply to a curved surface. In particular, a geodesiccircle may be defined as the curve which is a constant geode-sic distance from a fixed point. Similarly, a geodesic parallelto a reference curve is the curve which is a constant geodesicdistance from that curve. (Thus a circle is a special case of aparallel obtained in the limit when the reference curve degen-erates to a point.) Parallels occur naturally when considering,for example, the 12-mile limit for territorial waters which

    is the boundary of points lying within 12 nautical miles of acoastal state.

    The geodesic curvature of a parallel can be expressed interms ofm 12 and M12. Let point 1 be an arbitrary point onthe reference curve with geodesic curvature 1. Point 2 isthe corresponding point on the parallel, a fixed distance s12away. The geodesic curvature of the parallel at that point isfound from Eqs. (29) and(30),

    2= M211 (1 M12M21)/m12

    m121 +M12. (34)

    The curvature of a circle is given by the limit 1 ,2= M21/m12. (35)If the reference curve is a geodesic (1 0), then the cur-vature of its parallel is

    2= (1 M12M21)/(M12m12). (36)If the reference curve is indented, then the parallel intersectsitself at a sufficiently large distance from the reference curve.This begins to happen when2 in Eq. (34).

    The results above apply to general surfaces. For a geode-sic on an ellipsoid of revolution, the Gaussian curvature ofthe surface is given by

    K= (1 e2 sin2 )2

    b2 = 1

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

    Helmert(1880, Eq. (6.5.1)) solves Eq. (27)in this case togive

    m12/b=

    1 + k2 sin2 2cos 1sin 2

    1 + k2 sin2 1sin 1cos 2 cos 1cos 2(J(2) J(1)), (38)

    1 3

  • 8/10/2019 Algorithms for Geodesics

    6/13

    48 C. F. F. Karney

    M12= cos 1cos 2 +

    1 + k2 sin2 21 + k2 sin2 1

    sin 1sin 2

    sin 1cos 2(J(2) J(1))1 + k2 sin2 1

    , (39)

    where

    J( ) =

    0

    k2 sin2 1 + k2 sin2

    d

    = sb

    0

    11 + k2 sin2

    d

    = I1( ) I2(). (40)

    Equation (39) may be obtained from Eq. (6.9.7) ofHelmert(1880), which gives dm12/ds2;M12may then be found fromEq. (29) with an interchange of indices. In the spherical limit,

    f 0, Eqs.(38) and(39) reduce tom12= asin 12= asin(s12/a),

    M12= cos 12= cos(s12/a).

    The integral I2( )in Eq.(40) may be expanded in a Fou-rier series in similar fashion to I1( ), Eq.(15),

    I2( ) = A2

    +

    l=1C2lsin 2l

    , (41)

    where

    A2= (1 )

    1 + 14 2 + 964 4 + 25256 6 +

    , (42)

    C21= 12 + 116 3 + 132 5 + ,C22= 316 2 + 132 4 + 352048 6 + ,C23= 548 3 + 5256 5 + ,C24= 35512 4 + 7512 6 + ,C25= 631280 5 + ,C26= 772048 6. (43)

    4 Inverse problem

    The inverse problem is intrinsically more complicated thanthe direct problem because the given included angle, 12inFig.1,is related to the corresponding angle on the auxiliarysphere12via an unknown equatorial azimuth0. Thus, theinverse problem inevitably becomes a root-finding exercise.

    I tackle this problem as follows: Assume that 1is known.Solve the hybridgeodesic problem: given 1, 2,and 1,find12 correspondingtothefirstintersectionofthegeodesicwith

    the circle of latitude 2. The resulting 12differs, in general,from the given 12; so adjust 1using Newtons method untilthe correct12is obtained.

    I begin by putting the points in a canonical configuration,

    1 0, 1 2 1, 0 12 . (44)

    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. Allgeodesics with 1 [0, ]intersect latitude 2 with 12[0, ]. Furthermore, the search for solutions can be restrictedto 2 [0, 12 ], because this corresponds to the first inter-section with latitude2.

    Meridional (12=0 or ) and equatorial (1= 2=0,with12 (1 f) ) geodesics are treated as special cases,since the azimuth is then known: 1= 12 and 1= 12 ,respectively. The general case is solved by Newtons methodas outlined above.

    The solution of the hybrid geodesic problem is straight-forward. Find 1 and 2 from Eq.(6). Solve for 0 and 2from Eq.(5), taking cos 0 >0 and cos 2 0. In order tocompute2accurately, use

    cos 2=+

    cos2 1cos2 1 + (cos2 2 cos2 1)cos 2

    , (45)

    in addition to Eq. (5). Compute 1, 1, 2, and 2 usingEqs. (11) and(12). Finally, determine 12(and, once conver-gence is achieved, s12) asin the solutionto the directproblem.The behavior of12as a function of1is shown in Fig.4.

    To apply Newtons method, an expression for d12/d1

    is needed. Consider a geodesic with initial azimuth 1. If theazimuth is increased to 1+ d1with its length held fixed,then the other end of the geodesic moves by m12d1 in adirection 12 + 2. If the geodesic is extended to intersectthe parallel 2 once more, the point of intersection movesbym12d1/ cos 2(see Fig.5). The radius of this parallel isacos 2; thus the rate of change of the longitude differenceis

    d12d1

    = m12a

    1

    cos 2cos 2. (46)

    This equation can also be obtained from Eq. (6.9.8b) of

    Helmert(1880). Equation (46) becomes indeterminate when2= 1and 1= 12 , becausem 12and cos 2both van-ish. In this case, it is necessary to let 1= 12 + and totake the limit 0, which gives

    d12d1

    =

    1 e2 cos2 1sin 1

    (1 sign(cos 1)), (47)

    where sign(cos 1)= sign(). A numerical example ofsolving the inverse geodesic problem by this method is givenat the end of the next section.

    1 3

  • 8/10/2019 Algorithms for Geodesics

    7/13

    Algorithms for geodesics 49

    0 45 90 135 1800

    45

    90

    135

    180

    1()

    1

    2

    ()

    (a)

    2= 30

    25

    15

    0

    15

    2530

    90 120 150 180177

    178

    179

    180

    (b)30

    29.8

    2= 29

    1()

    12

    ()

    Fig. 4 The variation of12 as a function of1 for 1= 30, var-ious 2, and the WGS84 ellipsoid. a 12 for 2= 0, 15, 25,and 30. For |2| < |1|, the curves are strictly increasing, while for2

    = 1, the curves are non-decreasing with discontinuities in the

    slopes at 1= 90. An enlargement of the top right cornerofa isshown inbwith2 [29, 30] at intervals of 0.2

    = 1

    1

    A

    2

    B B= 2

    d1

    m12

    d1

    m12

    d1sec

    2

    Fig. 5 Finding d12/d1with1and 2held fixed

    Vincenty (1975a), who uses the iterative method ofHelmert (1880, 5.13) to solve the inverse problem, wasaware of its failure to converge for nearly antipodal points.In an unpublished report (Vincenty 1975b), he gives a mod-

    ification of his method which deals with this case. Unfortu-nately, this sometimes requires many thousands of iterationsto converge, whereas Newtons method as described hereonly requires a few iterations.

    5 Starting point for Newtons method

    To complete the solution of the inverse problem a good start-ing guess for1is needed. In most cases, this is provided byassuming that12= 12/w, where

    w=

    1 e2((cos 1 + cos 2)/2)2 (48)and solving for the great circle on the auxiliary sphere, using(Vincenty 1975a)

    z1= cos 1sin 2 sin 1cos 2cos 12

    +icos 2sin 12,

    z2= sin 1cos 2 + cos 1sin 2cos 12+ icos 1sin 12,

    1= phz1, (49)2= phz2, (50)

    12= ph(sin 1sin 2 + cos 1cos 2cos 12 + i |z1|).(51)

    An example of the solution of the inverse problem by thismethod is given in Table3.

    Table 3 First sample inverse calculation specified by 1 =30.12345, 2= 30.12344, and 12= 0.000 05. Because thepoints arenot nearly antipodal, an initial guess for 1is found assuming12= 12/w. However, in this case, the line is short enough that theerror in12is negligible at the precision given and the solution of theinverse problem is completed by using s12= aw12. More generally,the value of1would be refined using Newtons method

    Qty. Value Eq.

    1 30.12345 Given2 30.12344 Given12 0.00005 Given

    Determine12

    1 30.03999083821 (6)2 30.03998085491 (6)w 0.99748847744 (48)

    12 0.00005012589 12/w12 0.00004452641 (51)Solution

    1 77.04353354237 (49)2 77.04350844913 (50)s12 4.944208 m aw12

    1 3

  • 8/10/2019 Algorithms for Geodesics

    8/13

    50 C. F. F. Karney

    This procedure is inadequate for nearly antipodal pointsbecause both the real and imaginary components ofz1 aresmall and 1depends very sensitively on 12. In the corre-sponding situation on the sphere, it is possible to determine1 by noting that all great circles emanating from A meetat O, the point antipodal to A. Thus 1 may be determinedas the supplement of the azimuth of the great circle B O at

    O; in addition, because Band O are close, it is possible toapproximate the sphere, locally, as a plane.

    The situation for an ellipsoid is slightly different becausethe geodesics emanating from A, instead of meeting at apoint, form an envelope, centered at O , in the shape ofan astroidwhose extent is O(f)(Jacobi 1891, Eqs. (16)(17)). The position at which a particular geodesic touchesthis envelope is given by the conditionm 12= 0. However,elementary methods can be used to determine the envelope.Consider a geodesic leaving A(with 1 0) with azimuth1 [12 , ]. This first intersects the circle of opposite lat-itude, 2

    = 1, with 12

    = 12

    = and2

    =

    1.

    Equation(8) then gives

    12= fcos 1sin 1 +O (f2). (52)

    Defineaplanecoordinatesystem (x,y) centeredontheantip-odal point where = f acos2 1is the unit of length, i.e.,

    12= +

    acos 1x, 2= 1 +

    ay. (53)

    In this coordinate system, Eq. (52) corresponds to the pointx= sin 1,y= 0andtheslopeofthegeodesicis cot 1.Thus, in the neighborhood of the antipodal point, the geode-sic may be approximated by

    x

    sin 1+ y

    cos 1+ 1 = 0, (54)

    where terms of order f2 have been neglected. Allowing 1to vary, Eq. (54) defines a family of lines approximating thegeodesics emanating from A. Differentiating this equationwith respect to 1and solving the resulting pair of equationsfor x and y gives the parametric equations for the astroid,x= sin3 1, and y= cos3 1. Note that, for the order-ing of points given by Eq.(44),x

    0 and y

    0.

    Givenxand y (i.e., the position of point B ), Eq. (54) maybe solved to obtain a first approximation to 1. This prescrip-tion is given byHelmert(1880, Eq. (7.3.7)) who notes thatthis results in a quartic which may be found using the con-struction given in Fig.6. HereC O Dand B E Dare similartriangles; if the (signed) lengthB Cis , then an equation forcan be found by applying Pythagoras theorem to C O D:

    x2

    (1 + )2+ y2

    2= 1,

    OC

    B E

    D

    1

    y/

    yx/(1+)

    x

    2

    1

    Fig. 6 The solution of the astroid equations by similar triangles. Thescaled coordinates ofB are (x,y); Ois the point antipodal to A. Theline BC D, which is given by Eq. (54), is the continuation of the geo-desic from AB with Cbeing its intersection with the circle = 1and D its intersection with the meridian =1+ . The envelope oflines satisfyingC D=1 gives the astroid, a portion of which is shownby thecurves

    which can be expanded to give a fourth-order polynomial in

    ,

    4 + 23 + (1 x2 y 2)2 2y2 y 2 = 0. (55)Descartes rule of signs shows that, for y= 0, there is onepositive root (Olver et al. 2010, 1.11.ii) and this is the solu-tioncorrespondingtotheshortestpath.Thisrootcanbefoundby standard methods (Olver et al. 2010, 1.11.iii). Equa-tion(55) arises in converting from geocentric to geodeticcoordinates, and I use the solution to that problem given byVermeille(2002). The azimuth can then be determined fromthe triangleC O Din Fig.6,

    1= ph(y/ i x/(1 + )). (56)Ify= 0, the solution is found by taking the limit y 0,

    1= ph

    max(0, 1 x2) i x

    . (57)

    Tables4,5and6together illustrate the complete solution ofthe inverse problem for nearly antipodal points.

    6 Area

    The last geodesic algorithm I present is for geodesic areas.

    Here, I extend the method ofDanielsen (1989) to higherorder so that the result is accurate to round-off, and I recasthis series into a simple trigonometric sum.

    Let S12be the area of the geodesic quadrilateral A F H Bin Fig.1.FollowingDanielsen(1989), this can be expressedas the sum of a spherical term and an integral giving theellipsoidal correction,

    S12=S(2) S(1), (58)S( ) = c2 + e2a2 cos 0sin 0I4(), (59)

    1 3

  • 8/10/2019 Algorithms for Geodesics

    9/13

    Algorithms for geodesics 51

    Table 4 Second sample inverse calculation specified by 1 =30, 2= 29.9, and 12= 179.8. Because the points are nearlyantipodal, an initial guess for 1is found by solving the astroid prob-lem. Here is the positive root of Eq. (55). Ify=0, then1is givenby Eq. (57). The value of1is used in Table5

    Qty. Value Eq.

    1

    30 Given

    2 29.9 Given12 179.8 GivenSolve the astroid problem

    x 0.382344 (53)y 0.220189 (53) 0.231633 (55)

    Initial guess for1

    1 161.914 (56)

    where

    c2 = a2

    2+ b

    2

    2

    tanh1 ee

    (60)

    is the authalic radius,

    I4( ) =

    /2

    t(e2) t(k2 sin2 )e2 k2 sin2

    sin

    2 d, (61)

    t(x) =x+

    x1 + 1sinh1x.

    Expanding the integrand in powers ofe2 and k2 and per-

    forming the integral gives

    I4( ) =

    l=0C4lcos((2l+ 1)), (62)

    where

    C40=

    23 115 e2 + 4105 e4 8315 e6 + 643465 e8 1289009 e10

    120 135 e2 + 2105 e4 161155 e6 + 323003 e8

    k2

    + 142 163 e2 + 8693 e4 809009 e6 k

    4

    172 199 e2 + 101287 e4 k6+

    1110 1143 e2

    k8 1156 k10 + ,

    C41=

    1180 1315 e2 + 2945 e4 1610395 e6 + 3227027 e8

    k2

    1252 1378 e2 + 42079 e4 4027027 e6

    k4

    +

    1360 1495 e2 + 21287 e4

    k6

    1495 21287 e2

    k8 + 53276 k10 + ,

    Table 5 Second sample inverse calculation, continued. Here (0)12denotes the desired value of the longitude difference; Newtons method

    is used to adjust 1so that 12= (0)12. The final value of1is used inTable6

    Qty. Value Eq.

    1 30 Given2 29.9 Given1 161.914 Table4

    (0)12 179.8

    GivenSolve triangle N E A

    1 29.91674771324 (6)0 15.60939746414 (10)1 148.81253566596 (11)1 170.74896696128 (12)Solve triangle N E B

    2 29.81691642189 (6)2 18.06728796231 (5),(45)2 31.08244976895 (11)

    2 9.21345761110 (12)Determine12

    k2 0.00625153791662 (9)

    0.00155801826780 (16)

    1 170.61483552458 (8)2 9.18542009839 (8)12 179.80025562297 2 1Update1

    12 0.00025562297 12 (0)12J(1) 0.00948040927640 (40)J(2) 0.00031349128630 (40)

    m12 57288.000 110 m (38)d12/d1 0.01088931716115 (46)

    1 0.02347465519 12/(d12/d1)1 161.89052534481 1+ 1

    Next iteration

    12 0.00000000663

    1 161.89052473633

    C42= 12100 13150 e2 + 417325 e4 845045 e6 k

    4

    11800 12475 e2 + 26435 e4 k6+

    11925 25005 e2

    k8 12184 k10 + ,

    C43=

    117640 124255 e2 + 263063 e4

    k6

    110780 114014 e2

    k8 + 545864 k10 + ,

    C44=

    1124740 1162162 e2

    k8 158968 k10 + ,

    C45= 1792792 k10 + . (63)

    1 3

  • 8/10/2019 Algorithms for Geodesics

    10/13

    52 C. F. F. Karney

    Table6 Second sample inverse calculation, concluded.Here the hybridproblem (1, 2, and 1 given) is solved. The computed value of12matches that given in the specification of the inverse problem in Table 4

    Qty. Value Eq.

    1 30 Given2 29.9 Given

    1 161.89052473633 Table5Solve triangle N E A

    1 29.91674771324 (6)0 15.62947966537 (10)1 148.80913691776 (11)1 170.73634378066 (12)Solve triangle N E B

    2 29.81691642189 (6)2 18.09073724574 (5),(45)2 31.08583447040 (11)2 9.22602862110 (12)

    Determine s12and12

    s1 16539979.064227 m (7)s2 3449853.763383 m (7)

    s12 19989832.827610 m s2 s11 170.60204712148 (8)2 9.19795287852 (8)12 179.80000000000 2 1Solution

    1 161.89052473633

    2 18.09073724574

    s12 19989 832.827 610 m

    An example of the computation ofS12is given in Table7.SummingS12,Eq. (58), over the edges of a geodesic poly-

    gon gives the area of the polygon provided that it does notencircle a pole; if it does, 2 c2 should be added to the result.ThefirstterminEq.(59) contributes c2(2 1) toS12. Thisis the area of the quadrilateralA F H Bon a sphere of radius cand it is proportional to its spherical excess, 2 1,thesumof its interior angles less 2 . It is important that this term becomputed accurately when the edge is short (and 1and 2are nearly equal). A suitable identity for 2 1is given byBessel(1825, 11)

    tan2 1

    2 = sin

    12 (2 + 1)

    cos 12 (2 1)tan

    12

    2 . (64)

    7 Implementation

    The algorithms described in the preceding sections can bereadily converted into working code. The polynomial expan-sions, Eqs.(17), (18), (21), (24), (25), (42),(43), and (63),

    Table 7 The calculation of the area between the equator and the geo-desic specified by 1= 40, 1= 30, and s12= 10 000 km. Thisuses intermediate values computed in Table2

    Qty. Value Eq.

    0 22.55394020262 Table21 30 Table2

    2 149.09016931807 Table21 43.99915364500 Table22 133.92164083038 Table2k2 0.005 748 029 628 57 Table2

    Compute area

    I4(1) 0.479 018 145 20 (62)

    I4(2) 0.461 917 119 02 (62)S(1) 21298942.66715 km

    2 (59)

    S(2) 105574566.08950 km2 (59)

    S12 84275623.42235 km2 (58)

    are such that the final results are accurate to O(f6)whichmeans that, even for f= 1150 , the truncation error is smallerthan the round-off error when using IEEE double precisionarithmetic (with the fraction of the floating point numberrepresented by 53 bits). For speed and to minimize round-offerrors, the polynomials should be evaluated with the Hornermethod. The parenthetical expressions in Eqs. (24), (25),and(63) depend only on the flattening of the ellipsoid and canbe computed once this is known. When determining manypoints along a single geodesic, the polynomials need be eval-uated just once.Clenshaw(1955) summation should be used

    to sum the Fourier series, Eqs.(15), (23),(41), and (62).There are several other details to be dealt with in imple-

    menting the algorithms: where to apply the two rules forchoosing starting points for Newtons method, a slightimprovement to the starting guess Eq. (56), the convergencecriterion for Newtons method, how to minimize round-offerrors in solving the trigonometry problems on the aux-iliary sphere, rapidly computing intermediate points on ageodesic by using 12 as the metric, etc. I refer the readerto the implementations of the algorithms in Geographic-Lib (Karney 2012) for possible ways to address these issues.The C++ implementation has been tested against a large set

    of geodesics for the WGS84 ellipsoid; this was generatedby continuing the series expansions to O (f30)and by solv-ing the direct problem using high-precision arithmetic. Theround-off errors in the direct and inverse methods are lessthan 15 nanometers and the error in the computation of theareaS12is about 0.1 m2. Typically, 2 to 4 iterations of New-tons method are required for convergence, although in atiny fraction of cases up to 16 iterations are required. Noconvergence failures are observed. With the C++ implemen-tation compiled with the g++ compiler, version 4.4.4, and

    1 3

  • 8/10/2019 Algorithms for Geodesics

    11/13

    Algorithms for geodesics 53

    A A

    B

    B

    dt

    Fig. 7 The construction of the generalized gnomonic projection as thelimit of a doubly azimuthal projection

    running on a 2.66 GHz Intel processor, solving the directgeodesic problem takes 0.88 s, while the inverse problemtakes 2.34 s (on average). Several points along a geodesic

    can be computed at the rate of 0.37 s per point. These timesare comparable to those for Vincentys algorithms imple-mented in C++ and run on the same architecture: 1 .11 sfor the direct problem and 1.34 s for the inverse problem.(But note that Vincentys algorithms are less accurate thanthose given here and that his method for the inverse problemsometimes fails to converge.)

    8 Ellipsoidal gnomonic projection

    As an application of the differential properties of geode-sics, I derive a generalization of the gnomonic projectionto the ellipsoid. The gnomonic projection of the sphere hasthe property that all geodesics on the sphere map to straightlines (Snyder 1987, 22). Such a projection is impossible foran ellipsoid because it does not have constant Gaussian cur-vature (Beltrami 1865, 18); nevertheless, a projection canbe constructed in which geodesics are very nearly straight.

    The spherical gnomonic projection is the limit of the dou-bly azimuthal projection of the sphere, wherein the bear-ings from two fixed points Aand A to B are preserved, asAapproaches A(Bugayevskiy and Snyder 1995). The con-struction of the generalized gnomonic projection proceedsin the same way (see Fig.7). Draw a geodesic AB suchthat it is parallel to the geodesic A B at A. Its initial sep-aration from AB is sin dt; at B, the point closest to B,the separation becomes M12sin dt(in the limit dt 0).Thus the difference in the azimuths of the geodesics ABand A Bat A is(M12/m12) sin dt, which gives+ = (M12/m12) sin dt. Now, solving the planar triangleproblem withandas the two base angles gives the dis-tance ABon the projection plane asm12/M12.

    This leads to the following specification for the gener-alized gnomonic projection. Let the center point be A; foran arbitrary point B, solve the inverse geodesic problembetweenAand B ; then B projects to the point

    x= sin 1, y= cos 1, = m12/M12; (65)the projection is undefined if M12

    0. In the spheri-

    cal limit, this becomes the standard gnomonic projection,= atan 12 (Snyder 1987, p. 165). The azimuthal scaleis 1/M12and the radial scale, found by taking the derivatived/ds12and using Eq. (28), i s 1/M212. The reverse projectionis found by computing 1= ph(y+ i x), finding s12 usingNewtons method with d/ds12= 1/M212 (i.e., the radialscale), and solving the resulting direct geodesic problem.

    In order to gauge the usefulness of the ellipsoidal gno-monic projection, consider two points on the earth B andC,map these points to the projection, and connect them witha straight line in this projection. If this line is mapped backonto the surface of the earth, it will deviate slightly from

    the geodesic B C. To lowest order, the maximum deviationhoccurs at the midpoint of the line segment B C; empirically,I find

    h= l2

    32(K t)t, (66)

    wherel is the length of the geodesic, Kis the Gaussian cur-vature,Kis evaluated at the center of the projection A,andt is the perpendicular vector from the center of projec-tion to the geodesic. The deviation in the azimuths at theend points is about 4h/ l and the length is greater than thegeodesic distance by about 83 h

    2/l. In the case of an ellipsoid

    of revolution,Kis found by differentiating Eq. (37) withrespect to and dividing the result by the meridional radiusof curvature to give

    K= 4ab4

    e2(1 e2 sin2 )5/2 cos sin , (67)

    where is a unit vector pointing north. Bounding the magni-tude ofh, Eq.(66), over all the geodesics whose end pointslie within a distance rof the center of projection, gives (inthe limit that f andrare small)

    h

    r f

    8

    r3

    a3. (68)

    The maximum value is attained when the center of projectionis at= 45and the geodesic is running in an eastwestdirection with the end points at bearings 45or 135fromthe center.

    Others have proposed differentgeneralizations of the gno-monic projection.Bowring(1997) andWilliams(1997) givea projection in which great ellipses project to straight lines;Letovaltsev(1963) suggests a projection in which normalsections through thecenter point mapto straight lines.Empir-ically, I find that h/r is proportional to r/a andr2/a2 for

    1 3

  • 8/10/2019 Algorithms for Geodesics

    12/13

    54 C. F. F. Karney

    1000 km

    2000 km

    Fig. 8 Thecoast line of Europeand North Africain theellipsoidalgno-monicprojectionwithcenterat (45N, 12E) nearVenice.The graticulelinesare shown at multiples of 10. The twocirclesare centered on theprojection center with (geodesic) radii of 1000 and 2000 km. The dataforthe coast lines is taken from GMT (Wessel and Smith 2010) at low

    resolution

    these projections. Thus, neither does as well as the projectionderived above (for which h/ris proportional to r3/a3)atpre-serving the straightness of geodesics.

    As an illustration of the properties of the ellipsoidal gno-monic projection, Eq. (65), consider Fig. 8 in which a projec-tion of Europe is shown. The two circles are geodesic circlesof radii 1000 and 2000 km. If the geodesic between any twopoints within one of these circles is estimated using a straightline on this figure, the deviation from the true geodesic is less

    than 1.7 and 28 m, respectively. The maximum errors in theend azimuths are 1.1and 8.6, and the maximum errors inthe lengths are only 5.4 and 730 m.

    The gnomonic projection can be used to solve two geo-desic problems accurately and rapidly. The first is the inter-sectionproblem: given two geodesics between Aand B andbetweenC and D, determine the point of intersection, O.This can be solved as follows: Guess an intersection pointO(0) and use this as the center of the gnomonic projection;definea, b, c, das the positions ofA ,B, C,Din the projec-tion; find the intersection of AB andC D in the projection,i.e.,

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

    where indicates a unit vector(a= a/a)andz= x yis inthe direction perpendicular to the projection plane. Project oback 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.

    The second problem is the interceptionproblem: given ageodesic between A and B , find the pointO on the geodesic

    which is closest to a given pointC. The solution is similar tothat for the intersection problem; however, the interceptionpoint in the projection is

    o= c (b a)(b a) (a b z)z (b a)|b a|2 .

    Provided the given points lie within about a quarter meridian

    of the intersection or interception points (so that the gnomon-ic projection is defined), these algorithms converge quadrat-ically to the exact result.

    9 Conclusions

    The classical geodesic problems entail solving the ellipsoi-dal triangle N A B in Fig. 1, whose sides and angles arerepresented by 1, 2, s12and 1, 2, 12. In the direct prob-lem1, 1, ands12are given, while in the inverse problem1, 12, and2are specified; and the goal in each case is to

    solve for the remaining side and angles. The algorithms givenhere provide accurate,robust,and fast solutionsto these prob-lems; they also allow the differential and integral quantitiesm12,M12,M21, andS12to be computed.

    Much of the work described here involves applying stan-dard computational techniques to earlier work. However, atleast two aspects are novel: (1) this paper presents the firstcomplete solution to the inverse geodesic problem. (2) Theellipsoidal gnomonic projection is a new tool to solve variousgeometrical problems on the ellipsoid.

    Furthermore, the packaging of these various geodesiccapabilities into a single library is also new. This offers a

    straightforwardsolution of several interesting problems.Twogeodesic projections, the azimuthal equidistant projectionand the Cassini-Soldner projection, are simple to write andtheir domain of applicability is not artificially restricted, aswould be the case, for example, if the series expansion for theCassini-Soldner projection were used (Snyder 1987, 13);the scales for these projections are simply given in terms ofm12and M12. Several other problems can be readily tackledwith this library, e.g., solving other ellipsoidal trigonome-try problems and finding the median line and other maritimeboundaries. These and other problems are explored inKar-ney(2011). The web pagehttp://geographiclib.sf.net/geod.

    htmlprovides additional information, including theMaxima(2009) code used to carry out the Taylor expansions and aJavaScript implementation which allows geodesic problemsto be solved on many portable devices.

    Acknowledgments I would like to thank Rod Deakin, John Nolton,Peter Osborne, andthe referees of this paper for their helpful comments.

    OpenAccess This article is distributed under thetermsof theCreativeCommons Attribution License which permits any use, distribution, andreproduction in any medium, provided the original author(s) and thesource are credited.

    1 3

    http://geographiclib.sf.net/geod.htmlhttp://geographiclib.sf.net/geod.htmlhttp://geographiclib.sf.net/geod.htmlhttp://geographiclib.sf.net/geod.html
  • 8/10/2019 Algorithms for Geodesics

    13/13

    Algorithms for geodesics 55

    References

    Beltrami E (1865) Risoluzione del problema: Riportare i puntidi una superficie sopra un piano in modo che le lineegeodetiche vengano rappresentate da linee rette. AnnaliMat Pura Appl 7:185204. http://books.google.com/books?id=dfgEAAAAYAAJ&pg=PA185

    Bessel FW (1825) ber die Berechnung der geographischen Ln-

    gen und Breiten aus geodtischen Vermessungen. AstronNachr 4(86):241254.http://adsabs.harvard.edu/abs/1825AN......4..241B[translated into English by Karney CFF and Deakin REas The calculation of longitude and latitude from geodesic mea-surements. Astron Nachr 331(8):852861 (2010)]

    Bowring BR (1997) The central projection of the spheroid and surfacelines. Surv Rev 34(265):163173

    Bugayevskiy LM, Snyder JP (1995) Map projections: a reference man-ual. Taylor & Francis, London

    Christoffel EB (1868) Allgemeine Theorie der geodtischen Dreiecke.Math Abhand Knig Akad der Wiss zu Berlin 8:119176.http://books.google.com/books?id=EEtFAAAAcAAJ&pg=PA119

    Clairaut AC (1735) Dtermination gometrique de la perpendiculaire la mridienne trace par M Cassini. Mm de lAcad Roy desSciences de Paris 1733:406416. http://books.google.com/books?

    id=GOAEAAAAQAAJ&pg=PA406Clenshaw CW (1955) A note on the summation of Chebyshev series.Math Tables Other Aids Comput 9(51):118120

    Danielsen JS (1989) The area under the geodesic. Surv Rev 30(232):6166

    Gauss CF (1828) Disquisitiones Generales circa Superficies Cur-vas. Dieterich, Gttingen. http://books.google.com/books?id=bX0AAAAAMAAJ[translated into English by Morehead JCand Hiltebeitel AM as General investigations of curved surfacesof 1827 and 1825. Princeton Univ Lib (1902)http://books.google.com/books?id=a1wTJR3kHwUC]

    Helmert FR (1880) Die Mathematischen und Physikalischen Theori-een der Hheren Geodsie, vol 1. Teubner, Leipzig. http://books.google.com/books?id=qt2CAAAAIAAJ [translated into Englishby Aeronautical chart and information center (St Louis, 1964)

    as Mathematical and physical theories of higher geodesy, part 1.http://geographiclib.sf.net/geodesic-papers/helmert80-en.html ]Jacobi CGJ (1891) ber die Curve, welche alle von einem Pun-

    kte ausgehenden geodtischen Linien eines Rotationsellipsoidesberhrt. In: Weierstrass KTW (ed) Gesammelte Werke, vol 7.Reimer, Berlin, pp 7287. http://books.google.com/books?id=_09tAAAAMAAJ&pg=PA72 [op post, completed by WangerinFHA]

    Karney CFF (2011) Geodesics on an ellipsoid of revolution. Tech rep,SRI International.http://arxiv.org/abs/1102.1215v1

    Karney CFF (2012) GeographicLib, version 1.22.http://geographiclib.sf.net

    Legendre AM (1806) Analyse des triangles tracs sur la surface dunsphrode. Mm de lInst Nat de France, 1st sem, pp 130161.http://books.google.com/books?id=-d0EAAAAQAAJ&pg=PA130-IA4

    Letovaltsev IG (1963) Generalization of the gnomonic projection for aspheroid andthe principalgeodeticproblems involved in thealign-ment of surface routes. Geod Aerophotogr 5:271274 [translationof Geodeziya i Aerofotosemka 5:6168 (1963)]

    Maxima (2009) A computer algebra system, version 5.20.1. http://maxima.sf.net

    Olver FWJ, Lozier DW, Boisvert RF, Clark CW (eds) (2010) NISThandbook of mathematical functions. Cambridge UniversityPress,London.http://dlmf.nist.gov

    Oriani B (1806) Elementi di trigonometria sferoidica, Pt 1. MemdellIst Naz Ital 1(1):118198. http://books.google.com/books?id=SydFAAAAcAAJ&pg=PA118

    Oriani B (1808) Elementi di trigonometria sferoidica, Pt 2.Mem dellIst Naz Ital 2(1):158.http://www.archive.org/stream/memoriedellistit21isti#page/1

    Oriani B (1810) Elementi di trigonometria sferoidica, Pt 3.Mem dellIst Naz Ital 2(2):158.http://www.archive.org/stream/memoriedellistit22isti#page/1

    Rapp RH (1993) Geometric geodesy, part II. Tech rep, Ohio State Uni-versity.http://hdl.handle.net/1811/24409

    Snyder JP (1987) Map projectiona working manual. Profes-sional Paper 1395, US Geological Survey. http://pubs.er.usgs.gov/publication/pp1395

    Vermeille H (2002) Direct transformation from geocentric coordinatesto geodetic coordinates. J Geod 76(9):451454

    Vincenty T (1975a) Direct and inverse solutions of geodesics onthe ellipsoid with application of nested equations. Surv Rev23(176):8893 [addendum: Surv Rev 23(180):294 (1976)]

    Vincenty T (1975b) Geodetic inverse solution between antipodalpoints. http://geographiclib.sf.net/geodesic-papers/vincenty75b.

    pdf(unpublished report dated Aug 28)Wessel P, Smith WHF (2010) Generic mapping tools, 4.5.5.http://gmt.soest.hawaii.edu/

    Williams R (1997) Gnomonic projection of the surface of an ellipsoid.J Navig 50(2):314320

    1 3

    http://books.google.com/books?id=dfgEAAAAYAAJ&pg=PA185http://books.google.com/books?id=dfgEAAAAYAAJ&pg=PA185http://adsabs.harvard.edu/abs/1825AN......4..241Bhttp://adsabs.harvard.edu/abs/1825AN......4..241Bhttp://books.google.com/books?id=EEtFAAAAcAAJ&pg=PA119http://books.google.com/books?id=EEtFAAAAcAAJ&pg=PA119http://books.google.com/books?id=GOAEAAAAQAAJ&pg=PA406http://books.google.com/books?id=GOAEAAAAQAAJ&pg=PA406http://books.google.com/books?id=bX0AAAAAMAAJhttp://books.google.com/books?id=bX0AAAAAMAAJhttp://books.google.com/books?id=a1wTJR3kHwUChttp://books.google.com/books?id=a1wTJR3kHwUChttp://books.google.com/books?id=a1wTJR3kHwUChttp://books.google.com/books?id=qt2CAAAAIAAJhttp://books.google.com/books?id=qt2CAAAAIAAJhttp://geographiclib.sf.net/geodesic-papers/helmert80-en.htmlhttp://geographiclib.sf.net/geodesic-papers/helmert80-en.htmlhttp://books.google.com/books?id=_09tAAAAMAAJ&pg=PA72http://books.google.com/books?id=_09tAAAAMAAJ&pg=PA72http://arxiv.org/abs/1102.1215v1http://geographiclib.sf.net/http://geographiclib.sf.net/http://books.google.com/books?id=-d0EAAAAQAAJ&pg=PA130-IA4http://books.google.com/books?id=-d0EAAAAQAAJ&pg=PA130-IA4http://maxima.sf.net/http://maxima.sf.net/http://dlmf.nist.gov/http://books.google.com/books?id=SydFAAAAcAAJ&pg=PA118http://books.google.com/books?id=SydFAAAAcAAJ&pg=PA118http://www.archive.org/stream/memoriedellistit21isti#page/1http://www.archive.org/stream/memoriedellistit21isti#page/1http://www.archive.org/stream/memoriedellistit22isti#page/1http://www.archive.org/stream/memoriedellistit22isti#page/1http://hdl.handle.net/1811/24409http://pubs.er.usgs.gov/publication/pp1395http://pubs.er.usgs.gov/publication/pp1395http://geographiclib.sf.net/geodesic-papers/vincenty75b.pdfhttp://geographiclib.sf.net/geodesic-papers/vincenty75b.pdfhttp://gmt.soest.hawaii.edu/http://gmt.soest.hawaii.edu/http://gmt.soest.hawaii.edu/http://gmt.soest.hawaii.edu/http://geographiclib.sf.net/geodesic-papers/vincenty75b.pdfhttp://geographiclib.sf.net/geodesic-papers/vincenty75b.pdfhttp://pubs.er.usgs.gov/publication/pp1395http://pubs.er.usgs.gov/publication/pp1395http://hdl.handle.net/1811/24409http://www.archive.org/stream/memoriedellistit22isti#page/1http://www.archive.org/stream/memoriedellistit22isti#page/1http://www.archive.org/stream/memoriedellistit21isti#page/1http://www.archive.org/stream/memoriedellistit21isti#page/1http://books.google.com/books?id=SydFAAAAcAAJ&pg=PA118http://books.google.com/books?id=SydFAAAAcAAJ&pg=PA118http://dlmf.nist.gov/http://maxima.sf.net/http://maxima.sf.net/http://books.google.com/books?id=-d0EAAAAQAAJ&pg=PA130-IA4http://books.google.com/books?id=-d0EAAAAQAAJ&pg=PA130-IA4http://geographiclib.sf.net/http://geographiclib.sf.net/http://arxiv.org/abs/1102.1215v1http://books.google.com/books?id=_09tAAAAMAAJ&pg=PA72http://books.google.com/books?id=_09tAAAAMAAJ&pg=PA72http://geographiclib.sf.net/geodesic-papers/helmert80-en.htmlhttp://books.google.com/books?id=qt2CAAAAIAAJhttp://books.google.com/books?id=qt2CAAAAIAAJhttp://books.google.com/books?id=a1wTJR3kHwUChttp://books.google.com/books?id=a1wTJR3kHwUChttp://books.google.com/books?id=bX0AAAAAMAAJhttp://books.google.com/books?id=bX0AAAAAMAAJhttp://books.google.com/books?id=GOAEAAAAQAAJ&pg=PA406http://books.google.com/books?id=GOAEAAAAQAAJ&pg=PA406http://books.google.com/books?id=EEtFAAAAcAAJ&pg=PA119http://books.google.com/books?id=EEtFAAAAcAAJ&pg=PA119http://adsabs.harvard.edu/abs/1825AN......4..241Bhttp://adsabs.harvard.edu/abs/1825AN......4..241Bhttp://books.google.com/books?id=dfgEAAAAYAAJ&pg=PA185http://books.google.com/books?id=dfgEAAAAYAAJ&pg=PA185