Theory, strict formula derivation and algorithm development for the computation of a geodesic polygon area

The paper presents a coherent, original theory and an effective algorithm to calculate the surface area of a geodesic polygon, i.e. the area on an ellipsoid of revolution limited by geodesics, connecting pairs of subsequent vertices of known geographical coordinates. Using the cylindrical coordinate system and introducing an equatorial geodesic triangle, the novel strict recursive formulas were derived for the longitude on the ellipsoid and the distance along the geodesic and the area of a geodesic polygon. The area is determined by constant coefﬁcients, not the values of ﬁnite series. The orthodromic properties of geodesics, which led to the detection of bifurcation lines composed of the double solutions of the inverse geodetic problem were analysed. The novel algorithm presented, integrating the problem with geodesic polygon area calculation, is based on the newly proposed parameterisation with two alternative working unknowns and a new formula to obtain the initial value of the geodesic C parameter. It allows solutions for all cases, including near-antipodal or near-vertices, and offers two solutions if bifurcation occurs. The algorithm presented was tested and veriﬁed using numerical examples from known publications. The numerical tests proved the accuracy of 1m 2 of the computed geodesic area using standard IEEE 754 Double Floating Point PC arithmetic, for geodesic lengths up to ten thousand km.


List of symbols a
Equator semi-axis b Polar semi-axis f Flattening of ellipsoid of revolution e 2 Eccentricity of ellipsoid of revolution ϕ Geographic latitude β Parametric latitude (also referred to as reduced latitude) λ Geographic longitude or angle of rotation (angular coordinate) in cylindrical coordinate system z; ζ Azimuth (arc's azimuth) c; C c a G 1, 1 ; σ Second initial base integral used in the λ, S series; Arc length of the geodesic on the sphere Ls C 2 ; Le C 2 , ρ 2 P Decomposition coefficients (multipliers) of geographic longitude, used in the λ series Ss C 2 ; Se C 2 , ρ 2 P Decomposition coefficients of arc length of the geodesic, used in the S series A Surface area on the ellipsoid of revolution T Function of the area distribution along the meridian J i Base integrals of the area distribution along the meridian g 2, k Constant coefficients used in the series defining area under the geodesic G 2, k Base integrals used in the series defining area under the geodesic Ar C 2 , ρ 2 P Auxiliary function simplifying the formula for the calculation of the area under geodesic BIF Boolean variable determining whether bifurcation occurs C Starting estimate of the Clairaut's constant

Introduction
The computation of the surface area of polygons, whose sides are arcs of geodesics, is related to the knowledge of the exact parameters of geodesics equations. A geodesic is a unique, locally minimising length, curve joining two points on any surface, e.g. a straight line is a geodesic on a plane. Geodesics are used in classical geodetic problems of computing the geodetic coordinates, azimuths and distances on the surface of an ellipsoid of revolution. The formula of the accuracy of e 8 for calculating the area of a figure between the geodesic and the equator bounded by two meridians (referred to as the area under the geodesic) was formulated by Danielsen in 1989, but the practical application of this formula is difficult in terms of calculation. As a consequence, although storing and calculating data by their original geographical coordinates -currently being achieved easily and more and more accurately, e.g. from Global Navigation Satellite Systems -seems the ideal solution (as noticed also by many others researchers i.e. Canters and De Genst 1997, Leung et al. 2004, Chrisman 2017, users of data that define spatial location are mostly using coordinates expressed in traditional planar coordinate systems, based on cartographic map projections that allow for quick calculations of the area of polygons bounded by straight line segments on projected ellipsoids. The pragmatic choice is an equal-area projection, such as the Albers equal-area conic projection -used in the USA (Snyder 1987), the Lambert Azimuthal Equal-Area projection -recommended in the EU for statistical analysis and display (Annoni et al. 2001) or even Mollweide projection -still in use for world or sky maps (Snyder 1987). Even if an equal-area projection is used, however, the polygon border segments, i.e. the projected geodesics, do not coincide with straight lines, which is an important source of error of the surface area calculated in this manner. Moreover, many of these projections cover only a part of the globe, which generates additional calculation problems when calculating areas outside these mapping zones or outside the boundaries of the projected ellipsoid surface.
As an introduction to the topic of calculating the surface area on an ellipsoid, let us analyse the task of calculation of the surface area of a triangle on a sphere of radius R 7·10 6 7,000,000 m with the accuracy of 1m 2 , using the formula S R 2 ε, i.e. S 4.91 · 10 13 · ε, where ε is the spherical excess. The errors are propagated according to the formula σ s 4.9·10 13 · σ ε [m 2 ], σ s 1 [m 2 ], hence σ ε 2·10 -14 . Consequently, the angles must be determined with at least fourteen digits of precision. In contrast, the determination of the position x Rϕ 7 · 10 6 ϕ with the accuracy of σ x 1·10 -3 1 mm, means that the geographical coordinates need to be calculated with a precision of ten digits. In this context, the issue of the determination of the surface area of a polygon delimited by geodesics on an ellipsoid casts new light on the classical geodetic inverse problem and requires a decidedly higher computational precision.
The research presented here describes a new theory and approach to obtaining the explicit equation in cylindrical coordinates and the arc length of a geodesic on an ellipsoid of revolution and the surface area of a geodesic polygon, i.e. the area bounded by arcs of geodesics connecting vertices with known geographical coordinates such as Global Navigation Satellite System (GNSS) derived coordinates. The goal was to derive strict formulas and develop an algorithm that can quickly find the solution with high accuracy. Furthermore, the solution should be applicable to all cases, including nearantipodal and near-vertices cases.
The focus of this research includes the determination of the border path and surface area of a contour delineated by any feature on the surface of the Earth or any surface that is modelled by an ellipsoid of revolution. The feature's boundaries and surface area are determined unambiguously, regardless of the mapping projection and the accuracy of the computed result is only limited by the floating-point representation of the computing system used. For example, high accuracy of the boundary and surface area is needed not only for the maintenance of a cadastre at the national level, but also at the international level or to support the calculation of charges associated with the use of a given contour, such as territorial seas and the leases for the exploitation of the shelf's natural resources.
The three most important novel contributions of this theory and approach to accurately calculate the surface area of a geodesic polygon are as follows.
1. A new geometry on an ellipsoid is introduced, namely an equatorial geodesic triangle (see Sect. 5.1). This surface shape, bounded by three geodesics, simplifies determination of the area under the geodesic and, consequently, the area of a geodesic polygon on an ellipsoid that equals the total areas under the geodesics stretched on each pair of successive polygon vertices. 2. The difference between the reverse and forward azimuths (α 12 ) of the arc of a geodesic is directly determined, based on Napier's rules, thus avoiding subtraction which reduces the accuracy of the surface area calculation (see Sect. 7.2). 3. An innovative parameterisation of the inverse problem with two alternative working unknowns (see Sect. 7.1) to solve all cases is presented.
We extend the work by Karney (2013), Danielsen (1989) and Vincenty (1975Vincenty ( , 1976 in several ways: 1 A coherent original theory of ellipsoid geometry is presented; the novel, strict recursive formulas for the equation in cylindrical coordinates and the arc length of a geodesic, the area under the geodesic and the surface area of the geodesic polygon are derived; the area is determined by constant coefficients, not the values of finite series. 2 A cylindrical coordinate system is used and the integration is performed with respect to the radius of the circle of latitude, not to the frequently used reduced geodetic latitude. 3 The solution is applicable to any ellipsoid of revolution adopted as the reference surface, whether oblate or prolate. 4 The phenomenon of bifurcation, i.e. the existence of two different geodesic arcs of the same length connecting a given pair of points, leading to two solutions of the inverse geodetic problem, is detected. 5 A novel algorithm for solving the inverse problem, extended by the area under the geodesic calculation, is developed; it uses Newton's iterative process, and is based on the newly proposed parameterisation with two alternative working unknowns, providing a solution for all cases, including near-antipodal or near-vertices ones, and offers two solutions if bifurcation occurs. 6 A new formula is given to estimate the initial value of the geodesic C parameter, covering all cases, including near-antipodal or near-vertices ones, which replaces the fourth degree equation for Jacobi's (1891) astroid frequently used. 7 The accuracy of the resulting values, i.e. the geodesic arc length, longitude and the area under the geodesic, are only limited by the computer hardware.

Related works
The two fundamental geodetic operations are the problems of the geodesic on an ellipsoid: the direct problem is to find the position along the geodesic given a starting point, an initial heading (azimuth) and a distance; while the inverse problem is to find the distance and the forward and reverse azimuths given the latitude and longitude of the two points. Although these problems are fundamentally important, only few researchers have attempted to solve them from a theoretical standpoint, i.e. to derive the formulas and fully examine the existence of a solution. The aim of the published formulas or methods for solving these problems was usually to offer specific practical applications (e.g. triangulation), which typically referred to geodesics of a few tens of kilometres. Long geodesic arcs, antipodal and near-antipodal cases were rarely analysed. This section presents a non-exhaustive selection of significant contributions in the research of the length of geodesics and area on an ellipsoid. The issue of geodesics first appeared in the works of Clairaut (1733) and it was applied in geodesy in the form of the direct and inverse problem by Bessel (1826). The latter was the first to deal with long geodesics. Bessel developed a series expansion of elliptic integrals (distance and longitude) using an auxiliary sphere, while Helmert (1880) perfected the technology of the practical computation of the classical geodetic problems. Modifying the original Bessel method, Vincenty (1975, 1976 provided the formulas and algorithm for solving the problems that arose when technological progress brought the beginning of the computer era and improved accuracy of measurements. Although Vincenty did not present a derivation of the formulas, they have been published on the official website of the American National Geodetic Survey agency (www.ngs.noaa.gov) along with the original Fortran code, and they are widely known. Vincenty used the expansion of elliptical integrals into a series to modify Helmert's iterative method and achieved high computational efficiency, which was extremely important for military applications, to which the formulas were then dedicated. Using Vincenty's formulas, however, a failure to converge for near-antipodal points was noticed, which is proven by a very high number of iterations. This fact was mentioned by numerous authors, e.g. Rapp (1993), Karney (2013) or Tseng (2014).
The studies by Kivioja (1971) mark the beginning of a new trend, namely numerical integration of elliptical integrals. Its supporters, e.g. Thomas and Featherstone (2005), developed the numerical integration of the differential equation of the geodesic. The parallel numerical approach was initiated by Saito (1970) and then developed by Sjöberg (2006Sjöberg ( , 2012. This involves the numerical integration of elliptical integrals, which are usually functions of the elements of the ellipsoid and the auxiliary sphere. As far as the solutions for the longitude and distance along the geodesic are concerned, it is also worth noting the approaches using a recursion relation: by Levallois and Dupuy (1952) and by Pittman (1986). Pittman expressed the distance integral by a recursion formula consisting of base integrals. The delta lambda formula (longitude) involves double adding up (i.e. a series within a series). These are the only solutions that resemble some of the presented in this study, except that the recursion was used only for deriving formulas, not for calculations. Moreover, Pittman's formula, in particular, is very complex in computational terms, and its assumption that the initial approximation of the parameter is of spherical origin, makes it impossible to solve antipodal tasks. Pittman's significant contribution was to accelerate the convergence of the inverse geodetic problem's solution by using Newton's iterative process. Unfortunately, this method does not provide a solution if the end point of the geodesic arc is localised near its turning point, a problem of which Pittman is also aware. Moreover, Pittman's use of an approximate derivative increases the number of iterations; and this derivative equals zero if the end points of the geodesic arc lie on the same latitude.
The only formula to determine the surface area under a geodesic in geodetic coordinates on an ellipsoid was presented by Danielsen (1989), but this was not widely accepted at first. Danielsen derived a series to develop the formula to calculate the surface area under the geodesic and provided its six elements, each of which is a short finite series. The application of the formula requires the subtraction of two large, close numbers, calculated by a series, with a consequent sharp drop in the numerical accuracy of the result. Despite its imperfections, Danielsen's work represents a milestone in this field alongside that of Karney (2013), who popularised and extended it. Karney also used Newton's iterative process to accelerate the inverse geodetic problem convergence.

Equations for geodesics on a surface of revolution
When r , z, λ, cylindrical coordinates are used on the surface of revolution, a curve is determined by the arc length differential and azimuth ( Fig. 1) defined by formulas (1) and (2), where: r is the radius of a parallel (the distance of a point of the surface of revolution from the axis of rotation), λ is the longitude (also referred to as geodetic longitude if datum is specified), m is the meridian arc length, α is the azimuth of a curve in a given point. If a curve on a surface of revolution is a geodesic, it is characterised by Clairaut's relation (Clairaut 1733;Pressley 2010), also known as Clairaut's constant: It should be noted that this relation discloses the sinusoidal character of geodesics on a surface of revolution and the r ≥ |c| constraint for the radius of a parallel. It can be demonstrated that the radius takes the minimum value, i.e. r P |c|, if and only if P P 0 is a turning point of a geodesic.
Substituting (2) into (3) we get a new equation which determines the relationship between the longitude and the distance along a geodesic: From (4) it is important to note that the sign of the constant c determines the sign of dλ.
Substituting ds from Eq. (4) into Eq. (1) we get consecutively Substituting dλ from Eq. (4) into Eq. (5) we get successively After integrating Eq. (5) and (6), we obtain the explicit equation of a geodesic in cylindrical coordinates (7), i.e. longitude as a function of radius (often simply referred to as longitude), and the geodesic arc length (8) (often referred to as distance): The similarity of both integrals was exposed in the notation, which consequently leads to a very efficient algorithm of their simultaneous determination.

Equations of geodesics on the ellipsoid of revolution
An ellipsoid of revolution in cylindrical coordinates is described with equation Hence a , a -equatorial semi-axis, b -polar semi-axis.
It should be noted that the parameter which is commonly marked as e 2 can have a negative value, i.e. any ellipsoid of revolution can be adopted as the reference surface, whether oblate or prolate. Substituting Eq. (10) into Eq. (7) and Eq. (8) and introducing dimensionless values ρ r a , S s a , μ m a , C c a , we will get a description of the geodesic arc from the equator to the turning point (also referred to as the furthermost point of a geodesic), i.e. the longitude (11) and the distance (12) of the point of the radius ρ ρ P , respectively: Note that the following property occurs: |C| ≤ ρ P ≤ 1.

Integrals describing the arc of a geodesic from the equator to the turning point
Introducing an auxiliary binomial series of which the constant coefficients are expressible by a Newton's generalised binomial coefficient as Tseng (2014), however this requires more number of calculations than the proposed recursive formula (13). We will convert (11) and (12) integrals into a linear combination of basic integrals where basic integrals are as follows: Separating the derivative of the radicand, we will get Integrating the first integrand by parts, we will get the following expression Now, the following functional equation can be written as which, once rearranged, leads to a recursive relation enabling effective determination of basic integrals.
The two initial basic integrals can be obtained by substituting e 2 0 into formulas (11) and (12). They show the longitude (18) C · G 1, 0 (C; ρ P ) def ω and arc length (19) G 1, 1 (C; ρ P ) def σ of the geodesic on the sphere, which can be referred to as a special (boundary) case of an ellipsoid.
Since the basic integrals are positive and 0 ≤ ρ ≤ 1, the integrand (16) cannot increase with an increase in the i index, and hence G 1, i+1 ≤ G 1, i . This, in turn, allows us to show the convergence of series (14) and (15) based on Eq. (13).

Decomposition of formulas which determine the longitude and distance of a geodesic
The recursive formula (18,19,20) suggests that the basic integrals (20) depend on the two initial integrals, i.e. (18,19). Let us calculate the next integral: It turns out that the third term is eliminated and this and successive integrals are functions with the following form The new coefficients are determined from the converted recursive formula (20) Substituting (21) into formulas (14) and (15) we get the formulas which decompose integrals into spherical distance and position impacts (Eq. 24-27).
In this way, the elliptical integrals are expressed by combinations of elementary functions and polynomial series. Tseng (2014) obtained a similar character of the formulas for λ and S.
The practical application of formulas (24) and (25) is facilitated by the properties of the multipliers. Ls, Le, Se change in very narrow ranges (Table 1), while the γ i 1 (for i > 1) relation occurs on the equator (i.e. C 1). Therefore, based on Eq. (13): Formulas (24), (25) express the effect of the change of the polar axis (in respect to the equatorial axis) on the deformation of the sphere. The main influence of the flattening f propagates proportionally to the length σ . The remaining nonlinear part is proportional to the function E C 2 ; ρ 2 P . It follows from Eq. (17) that the function E equals zero at the equator E C 2 ; ρ 2 P 1 0 and at the turning points of a geodesic E C 2 ; ρ 2 P C 2 0, while its maximum is

Solution in spherical coordinates
Section 4.1 presents integrals providing the solution for the arc of a geodesic from the equator to the turning point of a geodesic. Let us introduce new variables leading to the extension of the solution to the entire geodesic. A sphere with geographical coordinates, marked by Karney as ω λ sfer and β ϕ sfer , is a boundary case of e 2 → 0 ellipsoid. In order to achieve full correspondence between the geodesics on the ellipsoid and the great circle on the sphere, we assume identical radii and azimuths, following Bessel (1826); hence ρ cos(β) where β is the parametric (also referred to as reduced) latitude related to the geodetic latitude ϕ by equation The essence of extending the solution beyond the part of the arc of the geodesic line from the equator to its turning point, is the following substitution: which allows to obtain the solution also on the southern hemisphere. Using Clairaut's relationship, we get the extension that (a) has a geometric interpretation and (b) determines the signs of the decomposition components. The extension defined by formulas (31-32) is fundamentally important since it makes it possible to apply formulas (24) and (25) to any arcs of geodesic. Moreover, it replaces the artificial determination of combinations of signs of individual components that occurs in Pittman's (1986) and Tseng's (2014) methods. Focusing more closely on the function E, which constitutes the nonlinear component of the longitude and the distance of the geodesic line defined by formulas (24) and (25), it is noted that it changes its sign when a geodesic crosses the equator (β 0) or passes through its turning point cos −1 cos −1 Fig. 2 Points of a geodesic representing some characteristic properties of the function E (Fig. 2). This is a direct consequence of the properties of the turning point of a geodesic, which can be made apparent by differentiating relation (3) The sign of the cosine changes when passing through the point(s) P P 0 where α ±π/2, which is precisely the turning point of a geodesic, thus r P |c| ⇔ ρ P |C|. Considering Eq. (28), β takes extreme values there, marking the northernmost or southernmost points of a geodesic.
Let examine the extreme values of the nonlinear terms in formulas (39) and (40). If ρ 2 1 ρ 2 2 , then, according to formula (42), we have Le 1 Le 2 ; Se 1 Se 2 , and from formula (17), it follows that |E 1 | |E 2 |. As a result, the absolute values of the nonlinear terms of both formulas become equal, i.e. |E 1 Le 1 | |E 2 Le 2 |, |E 1 Se 1 | |E 2 Se 2 |. Let us also note that the signs of the function E are determined by the rule derived from Eq. (32). As a result, the maximum of nonlinear influences occurs when points 1, 2 are situated on the same parallel, while for points located on antipodes the influences disappear (Fig. 2).
The remaining relevant properties of the function E for the points 1 to 6 lying on the geodesic line illustrated on Fig. 2 are as follows: E 2 E 4 E 6 0, E 3 −E 1 , E 5 E 1 .

Extension of the solutions to the entire geodesic
Using Eqs. (28-32) we reformulate Eqs. (18) and (19), i.e. the longitude and arc length of the geodesic on the sphere, in the following way All solutions of the equations are determined by formulas for any integer k (k ∈ Z): Substituting them into (24) and (25), we will get Hence, it can be concluded that a geodesic is infinite and, analogous to a sinusoid, it oscillates around the equator with a 2π (1 + |C|Ls) period, intersecting the equator in points β 0; λ k kπ (1 + |C|Ls). In practical applications, the geodesics do not exceed half of the period and finding the solution for k 0 or k 1 is not usually problematic.

Geodesic arc of length not exceeding half of the period
An arc of the geodesic with C parameter connects two points with reduced latitudes β 1 , β 2 if |C| ≤ ρ i cos(β i ) for i 1,2. Then There are two possible cases: if σ 12 < π then the spherical triangle meets the requirements for the Euler triangle, which enables the use of spherical trigonometry, or if σ 12 π then the spherical triangle degenerates to a biangle.

Area on an ellipsoid of revolution
Using the area differential on the ellipsoid dArea r dλ dm a 2 ρ dμ dλ (Fig. 1), we determine the area distribution T along the meridian, which is the area (dA) measured from the equator to the parallel with radius ρ P , between two differentially close (dλ) meridians Using the binomial series (13) we transform the integral (44) into a following form: In consequence, a linear combination of basic integrals is obtained as follows: Integrating by parts, we have hence the recursive formula Since all these integrals depend on the initial one, any of these integrals can be written as Substituting (49) into (45), we get Another method of calculating t k constants is worth analysing. Coefficients τ i, k compose a triangular table where 0 ≤ k ≤ i; i ≥ 0. The k th column of the table is necessary in order to compute t k . Let us compare the coefficients of the k th and k-1 st column in the same line. Using formula (50), we calculate successively

Hence, after division
By using the previous recursive relation we get After substituting (53), this becomes Substituting into (52) we get Hence, the recursive formula which replaces the computation of series (52) is We calculate the initial constant as After taking into consideration formulas (13) and (50), we get Extending the sequence for i > 3 results in the reduction in odd numbers in the numerator and denominator.
Hence, the final value of the constant For the oblate ellipsoid (e 2 > 0) the constant is determined with the well-known Mollweide's formula (Mollweide 1805;Biernacki 1949, p.254;p.266) t 0 1 2 + 1 − e 2 4e ln 1 + e 1 − e and for the prolate ellipsoid (e 2 < 0) the constant is determined with Wrinch's (1932) formula Obtaining the exact values of the constant coefficients t k is the key aspect of the theory of the area on the ellipsoid of revolution. The function T(ρ) (defined at the beginning of Chapter 5) makes direct determination of the area of a geographic rectangle (A rec ) possible as: and, consequently, the area of an ellipsoid (denoted as A ell ) composed of two geographic rectangles A ell 2 A rec (0 < ρ < 1, −π < λ < π) 4 π a 2 (T (0) − T (1)) 4 π a 2 t 0

Area of the equatorial geodesic triangle
Let us reformulate Eq. (14) as Substituting Eqs. (51) and (59) into (43), we will get the area of the equatorial geodesic triangle (denoted as A egt ), a geometry on an ellipsoid delimited by the geodesic, meridian and equator (e.g. shape 0,1,1', Fig. 3) where A(C, ρ P ) is the normalised area of the equatorial geodesic triangle that we use subsequently. After multiplying the two series in (60) and ordering using the variable k i + j, we get Then, denoting we get the area of interest as a linear combination of basic integrals Let us calculate the integral We convert the integrand to a form convenient for integration by parts (aiming at obtaining the derivative of the radicand in the numerator). We start with Then, integrating by parts, we get Hence, the recursive formula for the integral I k is Since the integral I 1 does not depend on I 0 (i.e. I 1 −C ρ 2 − C 2 ), the subsequent integrals have the form where the function θ k is described by recursive formula Substituting (66) into (63), we get where α 0 sin −1 (C) is the azimuth under which a geodesic crosses the equator. Substituting them subsequently into (64), we get And introducing the auxiliary function (Ar), which is the primitive function of the determined integral (60), we will get the normalised area of the equatorial geodesic triangle The use of the Ar function defined by the series (69), with fixed coefficients (62) and terms defined recursively (67), distinguishes formula (70) from the approximate formulas of Danielsen (1989) and Karney (2013) that use the coefficients defined by finite series.
The estimated values of constant coefficients (Table 2) indicate that the constants g 1, k ≈ e −2k . These eight coefficients are sufficient to determine the surface area of the Earth's ellipsoid (a 2 ≈ 4,068 ·10 +13 [m 2 ]) with an accuracy of 1 cm 2 , as long as the resolution of the floating point implementation allows it.
Since new formulas have been obtained, let us test them on the example of the surface area of the ellipsoid.
A biangle is a boundary case of an equatorial triangle. It is formed when the geodesic reaches the equator having crossed the turning point, then α π − α 0 . For the meridian C 0; α 0 0; the biangle holds ¼ of the ellipsoid. This observation allows to check the calculations by computing the ellipsoid area using the following alternative formula A ell 4 π g 2, 0 a 2 Based on formula (62), we obtain g 2, 0 t 0 , g 1, 0 t 0 , which in turn confirms that the result is consistent with formula (58). Danielsen (1989) called the area between a geodesic and the equator and the two meridians connecting to the end points of the arc of geodesic (Fig. 3) the area under the geodesic.

Area under the geodesic
It should be noted that the area under the geodesic connecting points 1 and 2 on an ellipsoid (A 12 ) can be defined as the difference between the areas of two equatorial triangles, i.e. 2,0,2' and 1,0,1' (Fig. 3). Hence A 12 A(C, β 2 ) − A(C, β 1 ) g 2, 0 α 12 + sin(2α 2 ) Ar C 2 , ρ 2 2 − sin(2α 1 ) Ar C 2 , ρ 2 1 (72) The sign of the area depends on the arc orientation, i.e. A 21 −A 12 . The area is positive for arcs oriented according to the direction of the azimuth increase. The accuracy of the area calculation mainly depends on the accuracy of the difference between the reverse and forward azimuths α 12 α 2 − α 1 and therefore it should be calculated directly in the polar triangle.
Similarly to formulas (24) and (25), formula (72) shows the effect of the change of the polar axis on the deformation of the sphere, except that the main effect of the flattening f is transferred proportionally by the coefficient g 2, 0 . The azimuth difference α 12 changes stepwise on the meridian, i.e. it takes the value π if points 1,2 are on either side of the pole, otherwise it equals 0. It follows that the pole causes problems in calculating the area.

Fig. 5 A circumpolar polygon (grey area)
which is in accordance with formula (73). Worth analysing also is the case of the geodesic polygon delimiting the area, which includes the pole, namely a circumpolar polygon (Fig. 5). Applying formula (73) to the circumpolar polygon, we obtain the following negative result: A gp (1, 2, 3, 4, 1) −A gp 1, 2, 2 , 1 , 1 − A gp 2, 3, 3 , 2 , 2 − A gp 3, 4, 4 , 3 , 3 − A gp 4, 1, 1 , 4 , 4 It is the only case when we get a negative result travelling along the polygon circumference according to the direction of the azimuth increase. As a matter of fact, this value applies to an area, which completes half of the ellipsoid area (the area marked in white in Fig. 5). While the area of the circumpolar polygon (A cmp ) is defined as:

Orthodromic path of a geodesic on an ellipsoid: The bifurcation phenomenon
Analysing the path of a geodesic connecting two equator points lying on the antipodes, one can see that two geodesics connect these two points, i.e. the equator and a meridian. On an oblate ellipsoid of revolution, the curve of the meridian is shorter and constitutes an orthodrome. The problem of the unequivocalness of a geodesic line, therefore, comes down to the question of when a geodesic constitutes an orthodrome.

Bifurcation of Clairaut's equation. Bifurcate antipodal nodes
Considering that a geodesic is defined by Clairaut's equation (ρ sin α C), it can be noted that there are two corresponding geodesics with the same parameter C, passing through a given point with β 0 , λ 0 coordinates. Their azimuths are α 1 sin −1 (C/ρ 0 ), α 1 π − α 1 , respectively. According to the theory of differential equations (the azimuth is a function of the first derivative, see formula (2)), this phenomenon is termed bifurcation (Kuszta and Bailey 1982).
Let us analyse the path of geodesic lines in Fig. 6: i. The geodesics, with the initial azimuth −π/2 < α 1 < π/2, rise towards the north to reach the northern turning point for a minimal radius of ρ |C|, after which they descend.
ii. The other geodesics descend towards the south to reach the southern turning point for a minimal radius of ρ |C|, after which they rise. iii. The corresponding geodesic lines intersect in the nodes lying on the on opposite parallel (−β 0 ) on the other (antipodal) side of the equator plane; the curve of each of the lines corresponds to half a period.
Starting from the origin point, the geodetic arcs: i. smaller than half of the period, do not intersect and are orthodromes, because they uniquely determine the shortest path from the origin point to a given point of the ellipsoid; ii. equal to half a period, intersect at the nodes with their bifurcation counterparts, i.e. they constitute two arcs of the same length from the origin point to the node, and both are orthodromes; iii. greater than half a period, are not orthodromes because they always intersect with the above-described orthodromes covering the entire ellipsoid.

Bifurcation line of the nodes for an oblate ellipsoid
The nodes of all geodesics coming from a specific point form a bifurcation line assigned to the point, shown in Fig. 6 as the bold part of the parallel. The bifurcation line is the geodesic uniqueness border: the starting point and a node link two orthodromes with the same length and azimuths, which complete π ; for instance α 1 30 o , α 2 150 o and α 1 150 o , α 2 30 o . The beginning of the bifurcation line lies at the turning point of the geodesic with azimuths α 1 90 o , α 2 90 o ; and its parameter C ρ 0 . Substituting it into formula (39), we will get λ min π 1 + |C|Ls C 2 Hence, the Boolean variable, which determines whether bifurcation occurs, is determined as: BIF (β 2 −β 1 ) and |λ 12 | ≥ π 1 + |C| Ls(C 2 ) (75) Let us consider the case of the bifurcation σ 12 ω 12 π at the equator. Then C ±1, α 1 α 2 ± π 2 , E 1 E 2 0, Ls − f , Ss 1 − f . And from Eq. (40), we obtain s 12 aS 12 a(1 − f )π bπ . It follows that the equator is an orthodrome, provided its curve segment does not exceed the length of a semicircle with a radius equal to the semi-minor axis of an ellipsoid. This can be illustrated by imagining an ellipsoid in which the semi-minor axis decreases to zero. In such a case, the ellipsoid becomes a flat disc, and the shortest line between the points on the equator becomes a chord.

Bifurcation line of the nodes for prolate ellipsoid
In case the equator semi-axis is smaller than the polar semiaxis, the half-period is greater than π , since the parameter f for such an ellipsoid is negative, as can be seen from Eq. (10). Before reaching the parallel −β 0 , the geodesic crosses the symmetrical geodesic with the azimuth α −α 1 . The intersection point lies on the antipodal meridian λ 0 + π , which is a bifurcation line for the prolate ellipsoid (e 2 < 0).
If the semi-axes are equal, the bifurcation line is reduced to the antipodal point, where all geodesics of a bundle meet.

The inverse problem extended with the area under the geodesic
The analysis of the problematic cases of the inverse problem, i.e. those involving the antipodes and the turning points of a geodesic, revealed issues related to the choice of parameters constituting the main equation, which manifest themselves as: (i) the lack of monotonicity of the function forming the equation; (ii) the consequent limitation of the applicability of Newton's method, which requires the existence of a nonzero derivative; and (iii) the difficulty of determining the initial estimate for the iterative process. The algorithms for solving the inverse problem are numerical solutions of an equation with one unknown. The classical methods of Bessel (1826) and their modifications, including the popular Vincenty's (1975) formulas, use ω 12 as a working variable, while Karney (2013) assumes, after Helmert (1880, that the azimuth α 1 constitutes a variable of the main equation. None of the methods used to date solves all cases of the inverse problem, and the reason for this is the selection of the controlled variable used in the iterations. The methods based on ω 12 variable encounter problems in near-antipodal areas, while the methods based on α 1 , do not provide a solution if the case involves the area near the turning point of a geodesic. Therefore, we will revise the parameterisation of the indirect problem with the aim to obtain solutions in all cases. We will use two functionally connected variables for parameterisation. The inverse problem is symmetrical with respect to the end points, consequently, the algorithm should not prefer any of them. In our algorithm, the initial data of our extended inverse geodetic problem are the same as for the classical inverse geodetic problem (i.e. latitude and longitude of two points: ϕ 1 , λ 1 , ϕ 2 , λ 2 ), while the outputs (i.e. α 1 , α 2 , s 12 , Ar 12 , Fig. 7 Polar spherical triangle 1,2,P and path of the geodesic. The coordinate system of the sphere is defined by longitude ω and latitude β Type, BIF) additionally include the numerical value of the surface area under geodesic (Ar 12 ), the Type variable specifying the result of dynamic parameter choice, taking the value C or S (discussed further in ch.7.1) and a Boolean flag indicating the occurrence of bifurcation (BIF).

Analysis of the inverse problem. Novel parameterisation
Considering the above reasoning, we decided to base the parameterisation of the inverse geodetic problem on two variables, namely ω 12 and C. The former is Bessel's (1826) well-known variable, and it represents the longitude on the auxiliary sphere (Fig. 7). It has been used by most authors of geodetic algorithms, including Vincenty (1975). In contrast, the latter variable (i.e. C) was introduced by Helmert (1880) as: C ρ min . The geometric interpretation of this variable is shown in Fig. 7 and is described by the following formula.
The fundamental equation is composed of the given values difference (i.e. λ 12 λ 2 − λ 1 ) and its value is expressed by formula (39) δ λ 12 − ω 12 − C σ 12 Ls C 2 + E 2 Le 2 − E 1 Le 1 0 Equation (76) is interpreted differently depending on the type of relations between the C and ω 12 variables. If bifurcation occurs, then the spherical triangle (Fig. 7) degenerates into a digon; σ 12 |ω 12 | π and the main equation becomes a function of the C parameter. The inverse problem has two solutions that meet Clairaut's relation. Such a case is assigned the discriminant BIF 1 in the output of the authors' implementations. Otherwise, the polar spherical triangle links C and ω 12 . Then, the inverse problem has one solution, and it is assigned the discriminant BIF 0.
We develop the fundamental Eq. (76) into a Taylor's series, neglecting the terms of the second and higher orders: δ(C + dC, ω 12 + dω 12 ) ∼ δ(C, ω 12 ) And the details of the differentiation are presented below. Let start with variable C.
The solution of the system of Eqs. (81), (84) reveals a direct impact of the coefficients of homogeneous Eq. (83) on the values of the unknowns. In practice, only the unknown with the greater effective impact on the free term of Eq. (80) is determined.
If inequality (89) is true, dC is determined (and Type C assigned to the solution) or, otherwise, dω 12 is determined (Type S). The choice of the dynamic (adaptative) parameter determines the way the polar triangle is defined, and results in fewer iterations.
After inserting the approximate values of d 1 , d 2 , the inequality takes the following form sin(σ 12 ) < |h 2 | f σ 12 It is true for σ 12 ≈ π , then the estimation turns into This means that the Type C solution is more effective in near-antipodal cases of an inverse problem.
The adaptative parameter choice was verified numerically. The numerical derivative of dλ 12 dC was found to be equal to δ dC , and the numerical derivative of dλ 12 dω 12 was found to be equal to δ dω 12 . The Newton's iterative process is stopped when |δ| ≤ ε, where ε is an arbitrary stop-criterion. Then, in the last stage of our extended inverse problem, the distance and area are calculated according to formulas (40) and (73).
The (81) and (84) system of equations is an indirect solution of the complex theoretical problem of the reduced length of the geodesic that was analysed by Gauss (1828) and Christoffel (1868). For example, Helmert's (1880) solution, later used by Karney (2013), requires laborious calculation of a specific series twice.

Two types of polar spherical triangles
The one type of polar spherical triangle (Type S) is defined by the determined value of ω 12 and the constant values β 1 , β 2 . This is a classical problem of spherical trigonometry, and its solution will be based on Napier's rules that enable direct determination of α 12 . If in any spherical triangle, two sides a, c are given and the angle B between them, then the cotangential formulas define the angles as follows: cos ( It results from the sine formula that q 2 sin(b)sin(A). While from the 'five-part rule' of spherical trigonometry, it results that q 1 sin(b)cos(A) hence, sin(b) q 2 1 + q 2 2 q 2 3 + q 2 4 q 5 . This allows the calculation of the missing triangle side: tan(b) q 5 cos(a) cos(c) + sin(a) sin(c) cos(B) Using these formulas for a polar triangle, we get tan(σ 12 ) q 5 ζ 1 ζ 2 + ρ 1 ρ 2 cos(ω 12 ) q 1 ρ 2 sin(ω 12 ), q 2 ρ 1 ζ 2 − ρ 2 ζ 1 cos(ω 12 ), We get the parameter of the geodesic from modified formula (77) C ρ 1 ρ 2 sin(ω 12 ) sin(σ 12 ) ρ 1 ρ 2 sin(ω 12 ) While, the azimuths and their difference will be derived directly from Napier's rules: The second type of the polar spherical triangle is defined by two sides and the C parameter of the third side. It is used for near-antipodal regions and for bifurcation, where the triangle shape is better defined by the C parameter. The case is assigned Type C since formula (3) allows the azimuths to be calculated using sin(α i ) C ρ i . In order to obtain an unambiguous solution, we check whether the polar triangle is obtuse. We analyse the cosine formula that determines the triangle side opposite to the azimuth cos π 2 − β 2 ζ 2 ζ 1 cos( σ 12 ) The second segment of the equation is negative, if α 1 > π 2 . Moving the first segment of the equation to the left side, we obtain the sign of the cosine of the missing angle: m 2 ρ 2 2 − C 2 ; if ζ 1 − ζ 2 cos(σ 12 ) ≥ 0 then m 2 −m 2 (100) Finally, the azimuths are determined from the formulas and their difference from the direct formula Let us determine ω 1 from formula (33) sin(ω 1 ) After substituting formula (99) cos(ω 1 ) m 1 1 − C 2 ρ 1 Finally, we get Hence, using formula (34) sin(σ 1 ) ζ 1 1 − C 2 we get tan(σ 12 ) m 1 ζ 2 − m 2 ζ 1 m 1 m 2 + ζ 1 ζ 2 (104)
The components of the fundamental Eq. (76) are estimated based on Table 1. Ls is the function of unknown C but it varies in very narrow ranges, and the extreme value Ls Ls m is taken for the initiation. Le takes low values, and Le 0 is assumed for the initiation. Thus substituting the fundamental equation simplified this way: into (77), we get C sin(σ 12 ) ρ 1 ρ 2 sin(λ 12 − Ls m σ 12 C) Expanding the sine into a Taylor's series, neglecting the terms of the second and higher order one gets the relation C sin(σ 12 ) ∼ ρ 1 ρ 2 sin(λ 12 ) − Ls m σ 12 ρ 1 ρ 2 cos(λ 12 ) C Hence, the formula for the initial value of the C parameter is as follows: C ρ 1 ρ 2 sin(λ 12 ) sin(σ 12 ) + Ls m σ 12 ρ 1 ρ 2 cos(λ 12 ) Although the approximation obtained is weaker than the 4 th degree equation of Jacobi's (1891) astroid, the tests revealed that it does not affect the number of iterations (see Sect. 7.5). As a result, the proposed algorithm is characterised by relatively low computational complexity.
Using the value of the variable C C in formula (76), the approximation of the value of the second variable can be improved.

Algorithm for calculating the surface area of a geodesic polygon
This pseudocode outlines how to calculate the area of a geodesic polygon, given a list of the geographic coordinates of its vertices. FUNCTION AreaPolygon uses FUNCTION AreaArc to calculate the area under the geodesic.

Comments on numerical application
The ellipsoid area amounts to 5.1·10 14 . This means that in order to record only the numerical values of the area with 1m 2 precision, we have to be able to use numbers with 15 decimal digits (49 binary digits). The common IEEE 754 Double Floating Point Format PC standard has a 52-bit mantissa, which is sufficient to record values with such high precision.

Numerical tests
The method was verified by comparing the results obtained in IEEE 754 Double Floating arithmetic (52 bits of mantissa) with the results obtained in IEEE 754 Extended Floating Point arithmetic (63 bits of mantissa). The tests data and results are listed in Table 3. In the first column the geodetic latitudes of the given points and the longitude difference are displayed. The distance, the forward and reverse azimuths, i.e. the solution of the inverse problem, are displayed in the second column. The last column lists the value of the surface area under the geodesic obtained in double and extended arithmetic (denoted as 'Area double' and 'Area extended', respectively), the difference between these results (denoted as 'diff'), the type specifying the result of dynamic parameter choice, taking the value C or S (as discussed in ch.7.1, and denoted as 'Type'), bifurcation occurrence indicator ('BIF') and the number of iterations ('Iter').
The relative accuracy of the area ranges from 5·10 -14 for the longest arcs to 5·10 -12 for the shortest ones. The tests revealed that 1m 2 accuracy is achieved for distances under 10,000 km. It needs to be emphasised that the presented innovative iterative algorithm is characterised by a low number of iterations (Iter, Table 3), compared to the number of iterations when Rapp's (1993) method was applied. Consequently, a We covered the calculation of the area of a geodesic polygon using the Bermuda Triangle as an example. The extended inverse problems listed in the last three rows of

Comment on existing methods
The main distinctive feature of the methods described for solving the inverse geodetic problem on arc 1-2 (Fig. 8) is the employment of different polar spherical triangles for the same purpose. Namely, Karney's or Tseng's method uses two triangles, i.e. (0, P, 1) and (0, 2, P); Pittman's method uses both the (1, P, V) and (2, P, V) triangles; while our method, like Vincenty's, use only one, i.e. the target triangle, i.e. (1, P, 2).
In those methods that use two triangles, in each iteration, the series to determine the longitude and distance for the two arcs are computed. Subtraction of the resulting large, often similar, numbers is then performed, resulting in a decrease in accuracy (number of significant digits). Additionally, in Pittman's method, the same series are also calculated for the geodesic arc from the equator to the turning point. In Karney's method, two dedicated series are calculated and then subtracted to determine the reduced length, which directly increases the number of calculations but also reduces the number of iterations by three times compared to Tseng's method.
The second distinguishing feature of our proposed approach is the use of recursively computed base functions common to both series, which greatly improves the computation of these series. In addition, our method uses strict derivatives that reduces the number of iterations.
Finally, it is worth emphasising that all methods of solving the inverse geodetic problem use Clairaut's formula (1733), most of them in its classical form, i.e. cos β sin α sin α 0 C Pittman's and Tseng's methods, on the contrary, use the following form cos β sin α cos β turningPoint C ≥ 0 which implicitly limits the azimuths to the interval 0 ≤ α ≤ π (note that in case this inequality is not satisfied, the right side of the Clairaut formula can be negative, while its left side is always positive). Consequently, such an approach complicates the algorithms as it requires additional operations, such as sign analysis of individual components.
In contrast to our work, the expansion of integrals into series was implemented by computer algebra systems in the work of Karney (2013) and Tseng (2014). Our approach, though laborious and time-consuming, resulted in the possibility of recursion discovery and brought us to an efficient (in a mathematical sense) and effective (in a computational sense) solution.

Conclusions
In this paper, we aimed to develop a coherent theory of the ellipsoid's geometry and accomplished our goal elaborating original, rigorous and implement convenient formulas for a geodesic polygon area, the longitude and the arc length of a geodesic based directly on geographical coordinates, e.g. from GNSS. While there were a number of partial approaches focusing on practical solutions for a longitude and distance along a geodesic for which approximate solutions were sufficient, we are unaware of any previous work that simultaneously attains the above-mentioned threefold goal.
In deriving the elliptical integral formulas, a system of cylindrical coordinates was used, whereby integration was carried out in reference to the normalised radius of parallel ρ, and not in reference to the reduced latitude, as most authors have done since Bessel. When developing the integrals for the geodesic longitude and arc length into a series, their unique similarity was used, i.e. it helped to use the same basic functions. A direct consequence of this method, in addition to being convenient to apply, is the decomposition of a series into two parts: depending on the distance and on the azimuth. This decomposition makes it possible to solve only one spherical triangle instead of two, as used by Danielsen (1989) and Karney (2013). This contributes indirectly to solving the issue of function periodicity, with which some scientists, such as Bessel (1826) and Pittman (1986), struggled, because the distance-dependent part of the formula is interconnected with periodicity.
The other significant objective of this study was to provide the formulas implementation algorithm to effectively obtain results with an accuracy that is limited only by the computer arithmetic applied. This objective was achieved though (a) formulas, defined with the use of constant factors and not with finite series values, as in previous formulas (cf . Danielsen 1989), as well as (b) the use of Napier's rules for the direct determination of the difference between the forward and reverse azimuths, and consequently (c) the elimination of their subtraction that reduces the accuracy of the surface area calculation.
The provided formulas are of recursive form that facilitates and simplifies their coding, which further contributes to a greater efficiency of our algorithm seizing Newton's rapidly converging iterative process and a new simple method to determine the geodesic C parameter's initial value for all cases, including those that previously required solving a 4 th degree equation describing Jacobi's (1891) astroid.
Newton's iterative process was constructed for two alternative parameters, C and ω. It is an indirect solution to a difficult theoretical problem of a reduced length of the geodesic investigated by Gauss (1828) and Christoffel (1868), and it replaces Helmert's solution (1880), which requires labour-consuming calculation of a special series. The proposed parameterisation with two alternative working unknowns includes all cases and, in particular, the cases when derivatives do not exist: near the turning point of a geodesic, where Karney's (2013) and Tseng's (2014) algorithm lose their convergence, and in the near-antipodal case, where Vincenty's (1975) algorithm diverges.
The orthodromic characteristics of a geodesic were analysed, which helped to detect the bifurcation lines on which there are two orthodromically equivalent solutions of a geodetic inverse problem, offered by the algorithm presented. New solutions were obtained of a polar geodesic triangle for near-antipodal and bifurcation cases defined by the C parameter value.
The algorithm presented was tested and verified using numerical examples from known publications and our original ones. The numerical tests, performed in extended and double arithmetic, proved the accuracy of 1m 2 of the computed geodesic area using standard IEEE 754 Double Floating Point arithmetic, for geodesic lengths up to 10,000 km.
The method described converges rapidly, despite the fact that the accuracy of the solution of the inverse geodetic problem 1·10 -15 , necessary to calculate the area, typically requires additional iteration. The number of iterations, like accuracy, depends on the length of the geodesic (cf. Tab.3): for short arcs, dominant in the applications, only one iteration is sufficient to obtain the final result, with the relative accuracy of the surface area being 5·10 -12 ; for long arcs, on the other hand, up to three iterations are sufficient and the relative accuracy is 5·10 -14 .
Summing up, we have achieved our goal of developing strict formulas, which are convenient for use in applications and implementations, and an innovative algorithm, which is characterised by its relative simplicity (executable in only a few steps and computationally less complex), its rapid convergence, its high accuracy (depending only on the floating point implementation), and its universal character (applicable for any ellipsoid of revolution and all cases, including nearantipodal cases, cases near the turning point of a geodesic or bifurcation case). unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecomm ons.org/licenses/by/4.0/.