1. INTRODUCTION
The definition of the connecting edge or line between two vertices is a minor great elliptic arc in Microsoft SQL Server (2014), whereas the more sophisticated definitions are the geodesics in the main geography databases (Oracle® Spatial Developer's Guide, 2013; ArcGIS Resource, 2014; Hipparchus® Tutorial and Programmer's Guide, 2004; IBM DB2 Universal Database 9.1., 2012). Great ellipse sailing has been studied in our previous work (Tseng et al., Reference Tseng, Guo, Liu and Wu2012a; Reference Tseng, Guo and Liu2013) and considering that the producers of Geographic Information Systems (GIS) and Electronic Chart Display and Information Systems (ECDIS) may adopt those databases in their systems, the geodesic algorithms need to be reviewed and studied.
The geodesic is of interest because it is the shortest path between two points on the Earth. In most terrestrial applications, the Earth is treated as a spheroid by adopting the World Geodetic System (WGS) 84 datum. Geodesics can also be used in the application of the United Nations Convention on maritime boundaries at sea; other uses involve distance measuring in GIS and ECDIS and governing rules of the Federal Aviation Administration bounding areas (Sjöberg, Reference Sjöberg2007; Reference Sjöberg2012).
Usual algorithms for the geodesic can be roughly divided into two groups: (a) numerical integration schemes and (b) series expansion of elliptic integrals. Group (a) can be further divided into integration schemes based on simple differential relationships of the spheroid (Kivioja, Reference Kivioja1971; Jank and Kivioja, Reference Jank and Kivioja1980; Thomas and Featherstone, Reference Thomas and Featherstone2005), or by numerical integration of elliptic integrals that are usually functions of elements in the spheroid and its corresponding auxiliary sphere (Saito, Reference Saito1970; Reference Saito1979; Sjöberg, Reference Sjöberg2007; Reference Sjöberg2012). Group (b) includes the original method of Bessel (Reference Bessel1826) that uses functions of elements in the spheroid related to a corresponding auxiliary sphere and various modifications to his method (Rainsford, Reference Rainsford1955; Vincenty, Reference Vincenty1975a; Bowring, Reference Bowring1983; Reference Bowring1984; Karney, Reference Karney2013).
The inverse geodetic problem on the spheroid is to determine the geodesic arc length between two endpoints and the azimuths of the arc. The more complete solution for the Clairaut constant (or the vertex latitude) which is compared with the solution provided by Sjöberg (Reference Sjöberg2007; Reference Sjöberg2012) is presented in this paper. If the two given points are not nearly antipodal, each azimuth and location of the geodesic is unique, while for the fixed points in the “nearly antipodal regions” and when the sum of the latitudes of two are equal to zero, there are two geodesics mirrored in the Equator and with complementary azimuths at each point. In the special case when the endpoints are located at the poles of the spheroid, all meridians are geodesics (Sjöberg, Reference Sjöberg2012). The special role played by the change of variable, the series integration in terms of CAS, finite difference method to obtain the vertices' latitude of a geodesic and an innovative iterative method proposed to replace Newton's method implemented by Karney (Reference Karney2013) makes this method different from others currently available.
The article is organised as follows: In Section 2, the basic equations needed and series solution for longitude in terms of latitude on a geodesic with specific phases to determine the actual geodesic are presented; Section 3 derives the series for the geodesic's arc length. Section 4 treats the inverse problem in the general cases and discusses some special issues relevant to the special cases, and at the end of Section 4, the flow chart of the algorithm is provided for the reader's convenience. Section 5 gives numerical examples with various conditions including the general case, the special case of geodesics passing two endpoints on nearly antipodal regions. The conclusions are summarised in Section 6.
2. FORMULA FOR LONGITUDE DIFFERENCE IN TERMS OF REDUCED LATITUDE ON A GEODESIC
Geodesic calculations all involve the Clairaut constant or latitude of the vertex along a geodesic, the relationship between the azimuth α and the reduced latitude β can be expressed by the relation (Clairaut, Reference Clairaut1735).
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:36509:20160415014831365-0301:S0373463314000228_eqn1.gif?pub-status=live)
where e is the first eccentricity, a, b is the semi-major and semi-minor axes, c is the Clairaut constant of a geodesic, β V is the latitude of vertex along the geodesic, and β is given by the relation shown below:
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:44830:20160415014831365-0301:S0373463314000228_eqn2.gif?pub-status=live)
where φ is geodetic latitude.
As mentioned, it is desirable to have a succinct theoretical statement of the solutions to the geodesic, covering all cases in hand before developing these problems' numerical solutions. Referring to Figure 1, it can be seen that the inverse problem is equivalent to solving the geodesic triangle ΔNP 1P 2 given two sides and their longitude difference (Δλ). This can be done in more than one way. By using the reduced latitude as the variable of integration such as those presented in Jank and Kivioja (Reference Jank and Kivioja1980) give the longitude and distance integrals as shown in Equations (3) and (4). If the Clairaut constant or latitude of the vertex and one point are given, then the latitude and longitude of any point P of the geodesic are related by Equation (3).
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:5111:20160415014831365-0301:S0373463314000228_eqn3.gif?pub-status=live)
The latitude and distance are related by Equation (4)
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:60355:20160415014831365-0301:S0373463314000228_eqn4.gif?pub-status=live)
where the semi-major axis a is 6378137 and eccentricity e is 0·0818191908426215 as adopted in the current WGS-84 ellipsoid model for the Earth.
Figure 1. Inverse problem of finding the shortest path between two end points.
Applying binomial theorem, Equation (1) and integral techniques expands Equation (3) to the expansion:
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:54489:20160415014831365-0301:S0373463314000228_eqn5.gif?pub-status=live)
where
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:22798:20160415014831365-0301:S0373463314000228_eqnU1.gif?pub-status=live)
The vertex latitude β V is always positive here. Equation (5) gives the longitude formula for the geodesic, and when the eccentricity equals zero, this longitude formula Equation (5) is the same as Napier's rules. Further using the change of variable gives the simplified integral as:
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:41427:20160415014831365-0301:S0373463314000228_eqn6.gif?pub-status=live)
where
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:85323:20160415014831365-0301:S0373463314000228_eqnU2.gif?pub-status=live)
By applying the binomial theorem again this expands the numerator in the right-hand side integrand of Equation (6) and this result can be exactly integrated as the following:
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:41953:20160415014831365-0301:S0373463314000228_eqn7.gif?pub-status=live)
where $u = \sqrt {1 - c^2  - x^2} $ and
$\sigma = \arctan ({\textstyle{x \over u}})$.
The expansion of Equation (6) can be conveniently integrated to arbitrarily order by CAS such as Maple® etc. which yields the two coefficient matrices by truncating the expansion at order e 10 up to M 4, as shown below:
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:17100:20160415014831365-0301:S0373463314000228_eqn8.gif?pub-status=live)
and
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:85175:20160415014831365-0301:S0373463314000228_eqn9.gif?pub-status=live)
where M •,i=[M 1,i … M 4,i ]T and i=1, 2.
The latitudes between interval [−β V, β V] cannot sketch all the geodesic segments of arbitrary length, so to overcome this disadvantage, one must introduce another variable t with interval [−∞ ∞] and also imply the following properties of Equation (10) which is related to latitudes.
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:87464:20160415014831365-0301:S0373463314000228_eqn10.gif?pub-status=live)
where p=FIX (t+β V, 2β V) is the number of phase (2β V) [FIX(..) rounds the element of (..) to the nearest integer] and Δt=REM (t+β V, 2β V) is the fraction of variable t in regard to the phase (REM computes the remainder after division).
As the relationship between variables t and latitude is many-to-one, Equation (10) is a periodical function that oscillates between two opposite vertices as shown in Figure 2.
Figure 2. The relationship of the oscillating reduced latitude between two vertices and variable t. Two different conditional integrals depend on the phase number.
The integral must be transformed into the following conditional function modified to accommodate variable t. But because although the range of variable t is [−∞ ∞], when integrating Equation (7) it will only give one corresponding value in the range of [−β V, βV], thus to solve this problem, one must first determine how many phases (β V) does the variable t have in regard to Equation (7). If even phases, then use the conditional function Equation (11) (top left rectangle in Figure 2), whereas if it equals odd phases, then use the other conditional (bottom left rectangle in Figure 2).
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:82459:20160415014831365-0301:S0373463314000228_eqnU3.gif?pub-status=live)
i.e.
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:65573:20160415014831365-0301:S0373463314000228_eqn11.gif?pub-status=live)
where the longitude difference Δλ V=λ(0, β V) of one phase equals one quarter cycle wrapping the Equator and the latitude β(t) defined in Equation (10).
Again when variable t is applied to Equation (1), it will only give one corresponding value in the range of [−βv βv]. We solve this problem by first determining how many phases (2β V) does variable t have in regard to 2β V. If the phases of variable t are even phases, then use the first condition of Equation (12) (top right rectangle in Figure 2), whereas then otherwise use the second condition of Equation (12) (bottom right rectangle in Figure 2), using Equation (1) gives the course function below on waypoints along the geodesic.
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:7428:20160415014831365-0301:S0373463314000228_eqnU4.gif?pub-status=live)
i.e.
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:93975:20160415014831365-0301:S0373463314000228_eqn12.gif?pub-status=live)
If the geodesic is westbound, the positive sign (+) is adopted, otherwise the negative sign (−) is adopted.
The two conditions of Equation (12) mean that the courses are northeast bound or southeast bound as shown in Figure 2, because the default travel direction in the canonical configurations is eastbound.
Apply Equation (11) to calculate the longitudes of the path departing from the first node to the fifth node (passing 2 cycles) where t has the interval [0°, 720°].
Figure 3 shows the oscillations of a geodesic on the spheroid and a great circle on the sphere. Point F on the geodesic crosses the Equator at longitude 0, heading in a northeast direction reaching a maximum northern latitude, then descends in a southeast direction crossing the Equator at a certain longitude, reaching a maximum southern latitude, then ascends in a north-eastern direction crossing the Equator again at point F1 (the red line). This is one cycle of the geodesic, but the longitude difference of the end of one cycle does not equal 360° due to the eccentricity of the spheroid and is not a closed curve, hence the geodesic does not repeat after a complete cycle, unlike its great circle counterpart which repeats after a complete cycle at point F2 (the brown line).
Figure 3. The oscillation of a geodesic on a spheroid. Note: The eccentricity has been increased to 0·5 in order to accentuate the spheroidal effects.
The geodesic curve will lag a certain longitude compared to a great circle after a complete cycle. Therefore after passing many circuits, it will wrap a band on the spheroid between two opposite vertices shown in Figure 4.
Figure 4. A geodesic curve wraps a band on a spheroid after many circuits.
Applying Equation (11) gives the longitude difference between the south and north vertices:
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:47978:20160415014831365-0301:S0373463314000228_eqn13.gif?pub-status=live)
where $x = \sin (\beta _V ) = \sqrt {1 - c^2} $.
The nearly antipodal regions are located within the interval [Δλ V, π]; there are two geodesics mirrored in the Equator and with complementary azimuths at each point (Figure 5). As stated before, in the special case when the given points are located at the poles of the spheroid, all meridians are geodesics (Sjöberg, Reference Sjöberg2012).
Figure 5. The variation of geodesic as a function of Clairaut constant c for starting point β 1=−30°. Note: the eccentricity exaggeratedly is set to 0·5.
The track of the two mirrored geodesics for various starting latitudes can be described by the definition of variable t shown below:
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:48593:20160415014831365-0301:S0373463314000228_eqn14.gif?pub-status=live)
and the longitudes and latitudes can be obtained by Equation (15):
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:91190:20160415014831365-0301:S0373463314000228_eqn15.gif?pub-status=live)
Using Equation (13) gives the nearly antipodal regions for various vertices shown in Figure 6.
Figure 6. Nearly antipodal regions at various vertices.
Figure 6 shows that the longitude difference between the two opposite vertices depends on the vertex. It equals π only when the constant c=0 and is slightly shorter than π. The geodesic is not closed around the spheroid for c≠0, and its period is somewhat shorter than 2π. Applying integration by parts gives a different integral for Equation (3):
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:11765:20160415014831365-0301:S0373463314000228_eqn16.gif?pub-status=live)
The longitude difference between the two opposite vertices has a minimum value when c equals one. As the latitude of the vertex approaches to zero, the LHS of integral Equation (16) vanishes. The exact formula of the longitude difference between two opposite vertices can be given or setting c=1 in Equation (13) also gives the approximate series Equation (17).
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:42738:20160415014831365-0301:S0373463314000228_eqn17.gif?pub-status=live)
The binominal series of the second last term of Equation (17) with respect to e 2 is approximately the last term of the above. This is the so-called “lift-off longitude” (Rapp, Reference Rapp1993). The antipodal region (Schmidt, Reference Schmidt2006) is located roughly within 36′.2 from the antipode at the Equator adopting the WGS-84 Earth datum.
3. ARC LENGTH IN TERMS OF REDUCED LATITUDE ON A GEODESIC
Geodesic distances are very important as they are the shortest distances. Applying the binomial theorem, Equation (1), and integral techniques expands Equation (4) to the series Equation (18):
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:97546:20160415014831365-0301:S0373463314000228_eqn18.gif?pub-status=live)
where
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:78966:20160415014831365-0301:S0373463314000228_eqnU5.gif?pub-status=live)
Setting x=sin β, thus using the change of variable transforms Equation (18) to Equation (19).
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:54133:20160415014831365-0301:S0373463314000228_eqn19.gif?pub-status=live)
Again, by using the binomial theorem, the numerator in the right-hand side integrand of Equation (19) may be expanded, and this result can be exactly integrated as Equation (20):
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:40538:20160415014831365-0301:S0373463314000228_eqn20.gif?pub-status=live)
where $u = \sqrt {1 - c^2  - x^2} $ and
$\sigma = \arctan ({\textstyle{x \over u}})$, and β V ⩽ β ⩽−β V.
Integrating Equation (19) in terms of CAS or handwork gives the two matrixes of coefficients by truncating the expansion at order e 10 and N 5 up to e 8 and N 4.
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:6289:20160415014831365-0301:S0373463314000228_eqn21.gif?pub-status=live)
and
where N •,i=[N 1,i … N 4,i ]T and i=1, 2.
Again, since the latitudes between the interval [−β VβV] cannot sketch all the geodesic segments of arbitrarily length, one must introduce the variable t as presented in Equation (10). The integral Equation (20) must be transformed into the following conditional function modified to accommodate variable t.
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:62147:20160415014831365-0301:S0373463314000228_eqn23.gif?pub-status=live)
where ΔS V=S(0, β V) is the distance from node to vertex as Equation (24) and the p as defined by Equation (11).
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:5274:20160415014831365-0301:S0373463314000228_eqn24.gif?pub-status=live)
The arc length of a geodesic is the meridian when the vertex is at the pole(s). This shows that the arc length between the two opposite vertices or two nodes depends on the Clairaut constant, and it shall equal the meridional distance when the constant c=0. Applying integration by parts gives a different integral Equation (25) for Equation (3).
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:10066:20160415014831365-0301:S0373463314000228_eqn25.gif?pub-status=live)
The geodesic arc length between the two opposite vertices has a minimum value when c=1. As before, as the latitude of vertex approaches zero, the LSH integral of Equation (25) vanishes, thus the exact formula of the curve length can be given or the setting c=1 of Equation (24) gives the series approximately.
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:31782:20160415014831365-0301:S0373463314000228_eqn26.gif?pub-status=live)
In the case of when c=1, the geodesic runs along the equator, Equation (26) is consistent with Equation (17). Applying Equations (17) or (26) gives the solution of antipodal region at the Equator.
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:61489:20160415014831365-0301:S0373463314000228_eqn27.gif?pub-status=live)
We apply the parameters according to WGS 84 to obtain the maximum distance aε=67·18197165 km along the geodesic on the Equator which is less than one half circle of the Equator. The great ellipse or the normal section passing antipodes located on the Equator cannot be determined, so the track along the Equator may be chosen for convenience. This means that the maximum distance difference between a geodesic and a great ellipse (or normal section) is the distance of one half circle of the Equator minus the length of one half elliptic arc length of the meridian as shown in Equation (28).
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:92283:20160415014831365-0301:S0373463314000228_eqn28.gif?pub-status=live)
In our previous work (Tseng et al., Reference Tseng, Guo and Liu2013), the maximum error for a longitude difference of 90° from the Equator to a certain latitude is about 7 metres at approximately 45° latitude. The results mean that nearly antipodal points at lower latitudes will generate bigger errors between the great ellipse and geodesic.
4. INVERSE PROBLEM OF GEODESIC SAILING
The inverse problem is intrinsically more complicated than the direct problem because the given longitude λ 12 is related to the corresponding unknown equatorial azimuth α 0 or latitude β V of the geodesic vertex. Thus, the inverse problem inevitably becomes a root-finding exercise. This problem can be tackled as follows.
Assume that β V is known. Solve the hybrid geodesic problem: given β 1, β 2, and β V, find the calculated λ 12 corresponding to the first intersection of the geodesic with the parallel of latitude β 2 which is the resulting longitude difference of given initial λ 12 in general cases; so adjust β V using Newton's method, secant method, or other root-finding methods until the correct λ 12 is obtained. The two endpoints can be put in a canonical configuration,
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:11469:20160415014831365-0301:S0373463314000228_eqn29.gif?pub-status=live)
This may be accomplished by swapping the end points and the signs of the coordinates if necessary, and the solution may similarly be transformed to apply to the original points. All geodesics with β V=[|β 1|, π/2] and α 1=[0, π] intersect the parallel of latitude β 2 with λ 12=[0, π]. Meridional (λ 12=0 or π) and equatorial (β 1=β 2=0, and λ 12<=(1− f)π) geodesics are treated as special cases. The general case is solved by the analog of Newton's method as outlined below. The longitude difference of a geodesic depends on its initial azimuth as northeast or southeast shown as the conditional Equation (30) that is constrained by Condition (29). If the course is southeast bound, then the reference initial point is near the destination and the geodesic passes the vertex and the variable t 1 is set to −2β V−β 1). Otherwise, the geodesic does not pass the vertex; the variable t 1 is set to β 1.
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:86442:20160415014831365-0301:S0373463314000228_eqn30.gif?pub-status=live)
where the direction logical variable NS is given in Equation (32).
The geodesic with vertex latitude β 1 departing from latitude β 1 intersects the parallel of the latitude β 2 at the longitude difference λ NS as shown in Equation (31):
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:72049:20160415014831365-0301:S0373463314000228_eqn31.gif?pub-status=live)
The following conditions give the azimuth of a geodesic. If longitude difference λ 12 is greater than the longitude difference λ NS of the intersection, the initial course of the geodesic is southeast bound, otherwise it is northeast bound as shown in Figure 5. The logical variable NS is decided by Equation (32):
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:54999:20160415014831365-0301:S0373463314000228_eqn32.gif?pub-status=live)
Vincenty (Reference Vincenty1975a) used the iterative method of Helmert (Reference Helmert1880) to solve the inverse problem and was aware of its failure to converge for nearly antipodal regions. In an unpublished report (Vincenty, Reference Vincenty1975b) gives a modification of his method which deals with this case. Unfortunately, this method sometimes requires many thousands of iterations to converge, whereas the approach shown below is used to approximate Newton's method and the innovative iterative method proposed here for nearly antipodal regions only requires a few iterations.
Karney (Reference Karney2013) uses Newton's method, requires a good starting guess and uses more complex procedures which even involves firstly calculating the reduced length of the geodesic and solving a fourth-order polynomial merely to find a good starting point, and may involve a high computational cost. Using Newton's Method solves the inverse problem by the derivative of longitude difference with respect to c or β V as shown:
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:54519:20160415014831365-0301:S0373463314000228_eqn33.gif?pub-status=live)
Differentiating the longitude difference function with respect to c gives
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:25515:20160415014831365-0301:S0373463314000228_eqn34.gif?pub-status=live)
where the derivative of the function with respect to c in-between the two opposite vertices is
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:96568:20160415014831365-0301:S0373463314000228_eqn35.gif?pub-status=live)
If the segment of the geodesic passes the vertex, the derivative of longitude difference function with respect to c or β V involves the segment of geodesic from the south vertex to the north vertex, which is non-differentiable as shown below.
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:90618:20160415014831365-0301:S0373463314000228_eqn36.gif?pub-status=live)
By using the finite difference method, the derivative can be completely replaced in all situations to avoid the non-differentiable condition as the following Equation (37).
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:60125:20160415014831365-0301:S0373463314000228_eqn37.gif?pub-status=live)
In the general case, the Clairaut constant and the reduced latitude of the vertex can be represented in terms of longitude difference and latitudes of the two given endpoints.
The starting point for Newton's method can be approximately obtained by the spherical model. In rectangular coordinates, any point on the unitary sphere can be represented as coordinates of
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:87424:20160415014831365-0301:S0373463314000228_eqn38.gif?pub-status=live)
where ω can be replaced with λ approximately for the first iteration.
The normal to the plane of a great circle is the cross product of the two vectors as shown:
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:87940:20160415014831365-0301:S0373463314000228_eqn39.gif?pub-status=live)
The latitude of the vertex equals to the angle between the Z-axis and the normal to the plane spanned by the two vectors.
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20267:20160415014831365-0301:S0373463314000228_eqn40.gif?pub-status=live)
Using the algebra symbolic system and the trigonometric identities expands the last expression as Equation (41)). Sjöberg (Reference Sjöberg2007; Reference Sjöberg2012) has also proven Equation (41) by spherical trigonometric methods.
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:12025:20160415014831365-0301:S0373463314000228_eqn41.gif?pub-status=live)
Using trigonometric identity rewrites the formula for the Clairaut constant c as Equation (42).
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:86676:20160415014831365-0301:S0373463314000228_eqn42.gif?pub-status=live)
If the two endpoints are located on the equator (β 1=β 2=0), then by applying Equations (13) and (17), the various cases for the Clairaut constant c can be determined by the following conditional Equation (43):
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:96647:20160415014831365-0301:S0373463314000228_eqn43.gif?pub-status=live)
If the two endpoints are located in the nearly antipodal regions (β 1+β 2=0) and 2Δλ V<λ 12), then applying Equations (13) and (17), the various cases for the Clairaut constant c can be determined by the following conditional Equation (44):
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:96337:20160415014831365-0301:S0373463314000228_eqn44.gif?pub-status=live)
where the vertex reduced latitude (β V) is subject to Equation (13) as the following repetitively:
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:88925:20160415014831365-0301:S0373463314000228_eqn45.gif?pub-status=live)
Truncating the series toward the first order gives the approximate Clairaut constant c as shown in Equation (46):
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:78292:20160415014831365-0301:S0373463314000228_eqn46.gif?pub-status=live)
The accurate value can be re-approached several times by the following iterative computation Equation (47) or Newton's method:
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:80456:20160415014831365-0301:S0373463314000228_eqn47.gif?pub-status=live)
Equation (47) shows that the solution to the Clairaut constant has unique values for the two ends in the nearly antipodal regions.
Applying the method of the asteroid plane provided by Karney (Reference Karney2013) can accelerate the speed of convergence. But the faster method implies a higher computational cost to solve the quartic equation before starting the iteration. Once the Clairaut constant and the coordinates of the end points of the geodesic are known, the azimuths of the geodesic at the end points may be determined from Equation (48)
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:36263:20160415014831365-0301:S0373463314000228_eqn48.gif?pub-status=live)
and
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:5334:20160415014831365-0301:S0373463314000228_eqn49.gif?pub-status=live)
Procedures for solving the geodesic inverse problem are summarised in Figure 7, which gives all the required algorithms clearly for the readers' convenience.
Figure 7. The flow chart of algorithm for solving the geodesic inverse problem.
5. NUMERICAL RESULTS FOR DISTANCE AND LONGITUDE EQUATIONS
Three examples are represented in this section. The first two samples are cited from Tables 4 and 5 of Karney (Reference Karney2013). Those data obtained from his results are compared with the results computed by the methods proposed here, which are also compared with the results obtained from the great ellipse (GE) provided in our previous work (Tseng et al., Reference Tseng, Guo, Liu and Wu2012a). Analysis of the efficiency and accuracy between such comparisons are shown in Tables 2 and 3. It can be seen that the innovative iterative method proposed here for nearly antipodal regions or general cases only requires a few iterations.
The first example is specified by φ 1=−30·12345°, φ 2=−30·12344°, and λ 12=0·00005° as shown in Figure 8 (left). Because the two points are not nearly antipodal, an initial guess for the reduced latitude β V of the vertex is found from Equation (41). However, in cases of when two points are very close to each other, the line is short enough that the error in β V is negligible; the solution of this inverse problem is completed by using finite difference or Newton's method as shown in Table 1.
Figure 8. The track (left) of geodesic between very closely points. The tracks (right) of geodesic and great ellipse from two nearly antipodal points.
Table 1. Comparing the results of calculations with two very close endpoints.
Note: Geo-K=differences between the result calculated here and Karney's result
As the two points are very close to each other, the line is very short and the differences between the geodesic and GE are very small; both sailing methods may be applied here, even using rhumbline or plane sailing (Tseng et al., Reference Tseng, Earle and Guo2012b) gives near identical results (shown in Table 1).
A second example is specified by φ 1=−30°, φ 2=29·9°, and λ 12=179·8° in Figure 8 (right). In this case, the points are nearly antipodal, an initial guess for the Clairaut constant c is found by solving Equation (46), then the solution of this problem is completed by using finite difference or Newton's method, the result is shown in Table 2.
Table 2. Comparing the results of calculations for Example 2.
The function [dist,az]=distance(lat1,lon1,lat2,lon2,ellipsoid) provided in the Mapping Toolbox® by MATLAB® computes the geodesic distance and azimuth assuming that the points lie on the reference ellipsoid defined by the input ellipsoid. This distance function of MATLAB adopts Vincenty's algorithm which sometimes requires many thousands of iterations or converges to a wrong answer in nearly antipodal regions, whereas the approximated Newton's method and innovative iterative method for nearly antipodal regions as described here only requires a few iterations. As shown in Table 2, Karney (Reference Karney2013) uses much more complex procedures which even involve calculating the reduced length of the geodesic and solving a fourth-order polynomial to merely find a good starting point for his method.
In the case of closely near antipodal regions, using the MATLAB® distance function for this problem gives the incorrect result; the initial course and distance have huge errors and cannot be accepted. The discrepancies between the results computed by the proposed methods described here and of those provided by Karney (Reference Karney2013) are negligible; the distance difference between the two is approximately 2·5 cm for this very long geodesic. These results show that the new methods proposed here can be accepted in practical sailing and geodesic calculations. The discrepancies have arisen from truncating the expansion of Equations (7) and (10) both at order e 10 leaving the series up to e 8, the truncated series generates errors in ae 8 order which are centimetre-level.
As shown in Table 3, the GE distance is 10812·32 m (5·9 nautical miles) further than the distance of geodesic with the same input values. Fortunately in most cases of navigation, the endpoints of practical sailing are seldom located closely in nearly antipodal regions.
Table 3. Determining route from Yokohama to Valparaiso.
The third numerical example presented has a very long navigational route with longitude differences between two endpoints of about 145°. The route is from Valparaiso-Chile (32° 59·998′S, 71° 36·675′W) to Yokohama-Japan (34° 26·178′ N, 139° 51·39 E).
The results of Example 3 are shown in Table 3. The geodesic is slightly more curved than the great ellipse (see Figure 9). The eccentricity is exaggerated and set to 0·5 to show the difference between the GE and geodesic. In this example the discrepancy between the two distances (GE: 9242·561583 nautical miles, geodesic: 9242·558019 nautical miles) is approximately 6·6 metres, for which the GE can be accepted for the practical purposes of navigation. As the track doesn't pass through the vertex, the differences of the two tracks are very small which can be negligible in practice. Also, the geodesic distance obtained from the truncated series provided here generates tiny discrepancies compared to those obtained from the different truncated series terms of the in-built function “geodesicinv.m” in MATLAB™; both generate near consistent results.
Figure 9. The track from Yokohama, Japan to Valparaiso, Chile.
As one can see from Table 3, our method converges very quickly after the first few iterations. The Δλ change of the calculated longitude difference and the given λ 12 also converge very quickly. In the computer program designed by us, the tolerance is set to 10−10 degree, the program designed for geodesic sailing here generates 50 linearly equally spaced points between the two latitudes β 1 and β 2, The behaviour of change in longitude decreases as the latitude approaches to the Equator as shown in Table 4.
Table 4. Waypoints on the geodesic from Yokohama to Valparaiso.
6. CONCLUSIONS
This study presents algorithms for determining the Clairaut constant or the vertex latitude from two given points on the spheroid. If the given points are not in the antipodal regions (AR) governed by Equation (13), the iterative formula of Equation (33) solves the vertex latitude. If the given points are in the AR, the alternative iterative procedure described in Equation (47) solves the Clairaut constant, in which in all cases the Clairaut constant and the vertex latitude are unique. Once the Clairaut constant or the vertex latitude is determined, the length, azimuths and waypoints along the geodesic are easily obtained. Outside the nearly AR the geodesic is unique, while for the endpoints within the AR there are generally dual geodesics mirrored in the equator, i.e. the azimuths are complementary at each point.
Our technique to solve the inverse geodetic problem is more accurate and complete than solutions found in other literatures mainly from the central role played by the initial course or Clairaut constant, where partial ideas of this were originally presented by Sjöberg (Reference Sjöberg2007; Reference Sjöberg2012). Once the constant or vertex latitude is given, the solution is straightforward. In this way we avoid the difficulties of finding the iterative solutions and the starting guess points in the AR which are as reported e.g. in Vincenty (Reference Vincenty1975a) and Karney (Reference Karney2013). With aid of CAS and basic calculus knowledge, the mathematical derivations presented here are more straightforward and understandable. The variable t is introduced to replace reduced latitude which has the interval between [−∞ ∞], using the conditional longitude and distance functions with the variable t can sketch any point on the geodesic. The methods provided here do not involve any auxiliary sphere and corresponding arguments which then need many spherical trigonometry formulae; our methods can reach arbitrary truncated series as the user's need is limited only by ability of the computer used.
The expressions derived here are suitable to both the syntax of computer algorithms and research purposes in the areas of sailing and cartographical computation in GIS and ECDIS environments. The differences of distances between the great ellipse and geodesic sailing passing two antipodal points will generate the greatest discrepancy whereas on the Equator, it can reach a maximum of about 18·1300799 nautical miles. This is not acceptable for practical purposes of navigation and ECDIS, and there may be alternatives to solve this problem, such as a compromised solution with two separated great ellipses sailing, which may be worth studying in the future. The proposed algorithm for geodesic sailing provides extremely high accuracies with efficiencies comparable to those algorithms provided by previous literatures. Numerical tests show that the algorithms of the geodesic provided here gives near identical results, yet it is faster and more direct than previous literatures, and can also be used in nearly antipodal regions where MATLAB®'s distance function often does not work correctly. The aim of this paper is to facilitate navigators and designers of GIS or electronic charts to design navigational software more efficiently, accurately, easily and much more understandably.
ACKNOWLEDGEMENT
This work was supported in part by the National Science Council of Taiwan, Republic of China, under grant NSC 98-2410-H-019-019-, NSC 99-2410-H-019-023-, 100-2410-H-019-018-, 101-2410-H-019-025-, and 102-2410-H-019-016-.