Rigorous spherical bearing with Soldner coordinates and azimuth angles on sphere

Meridian systems, called Soldner coordinates (parallel coordinate) systems, have found wide application in geodesy. In particular, the meridian system constitutes a suitable base for the Gauss-Kruger projection of the ellipsoid and the sphere. Soldner coordinates can be used in Cassini-Soldner projection without any processing. As it is known, the directions of the edges are shown with azimuth angles in the geographic coordinate system and the bearing angles in the Soldner coordinate system. Bearing or azimuth angles are frequently used in geodetic calculations. These angles give the direction of sides in the clockwise direction from a certain initial direction. Both angle values range from 0 to 360 degrees and are usually calculated from the arctan function. But the arctan function returns an angle value between -90 and +90 degrees. Therefore, it is necessary to analyze the quarter for the angle found. For practical computations, the quadrants of the arctangents are determined by the signs of the numerator and denominator in the tangent formulas. Determining the quarter of the angles is done with if…, then…, end..., blocks on the computer. It should be noted that each comparison requires a separate processing time. This study will be given how to calculate both bearing and azimu-th angles with direct formulas without any need to examine them. In addition, a solution proposal will be given against the division by zero errors in the bearing and azimuth angles calculations.


Introduction
The reciprocal bearing angles are exactly 180 degrees different on the plane. Unlike the plane on the sphere surface, the difference between reciprocal bearing or azimuth angle is approximately 180 degrees. Therefore, while a single bearing angle is sufficient in plane calculations, it is desired to find reciprocal bearing or azimuth angles separately on surfaces such as spheres and ellipsoids. Classic the bearing calculation or the azimuth calculation formulas only work correctly if the side is in the 1st quarter. If the side is located in the other quarters, the angles of the bearing or azimuth should be examined. For example, if the angle value given by the arctan function is positive, the bearing or azimuth angle is in the 1st or 3rd quarter. If the angle value is negative, the angle is in quarter 2 or 4. In order to find the value of the angle as univocal, the angle values found from the classical formulas need to be examined. Bearing or azimuth angles are critical in geodetic calculations. It is impossible to produce correct position information with wrong bearing or azimuth angles. Calculation of angles is done with the inverse (second) geodetic problem. While solving the inverse geodetic problem in order to find reciprocal bearing or azimuth angles, first, the angle from 1 to 2 is found. As a result of the analysis, if the 1st bearing or azimuth angle is wrong, it is likely to be wrong in the opposite (from 2 to 1) bearing or azimuth. In the proposed method, reciprocal bearing or azimuth angles are obtained independently and directly.
In our literature research, we came found some studies only for determining plane bearing angle (Antes, 1990;Breuer et al., 1985;Gellert et al., 1972) demonstrated direct bearing angle determination in the plane without quarter analysis. Hekimoglu (1991) also examined the condition problem and the direct formulas. We could not find any studies that give a direct bearing and azimuth angle on the spherical surface.
Formulas that give a direct azimuth angle on the sphere surface without examining the quarter with geographical coordinates are shown by the author in (Bektas, 2019;Bektas, 2021).
For the first time, in this study, formulas that give a direct bearing angle without examining the quarter with Soldner coordinates on the sphere surface will be discussed.
On the other hand, a solution proposal will be given against the division by zero errors in the bearing and azimuth angles calculations.
In this paper, firstly, bearing and azimuth angle, meridian system and Soldner coordinates on sphere will be mentioned in order to form a basis for the subject. After the relationship between azimuth, bearing angle and meridian convergence is given, direct azimuth angle determination with geographical coordinates, then direct bearing angle determination with Soldner coordinates will be discussed. Classically, the reciprocal azimuth angles (A 12 , A 21 ) from two points whose geographic coordinates P 1 (φ 1 , λ 1 ), P 2 (φ 2 ,λ 2 ) are given obtained from the following formulas ( Fig.1).

Direct Azimuth Angles with Geographical Coordinates
(1) (2) It is important to remember that these classic formulas only work correctly if the side is in the 1st quarter. If the side is located in the other quarters, the angles of the bearing angle should be examined. The necessary additions should be made for correct angles according to Table- In this proposed method, formulas are given for obtaining the azimuth angle directly without any examination. For direct determination of azimuth by geographic coordinates, we provide the below formulas. In this proposed method, formulas are given to obtain the azimuth angle directly without any examination. The proposed method can calculate direct azimuth angles on the sphere and ellipsoid surface (Bektas, 2019).

Direct Bearing Angles with Soldner Coordinates in Meridian System on Sphere
This meridian system, as the name suggests, is based on the meridian. The meridian that defines the system is called the prime meridian, and a meridian near the study area is taken as the prime meridian (Heck, 2003). o Soldner coordinates system, have found wide application in geodesy. In particular, the Soldner coordinates system constitutes a suitable base for projection of the ellipsoid and the sphere. Soldner coordinates can be used in Cassini-Soldner projection without any processing.
In this system, the x-axis is the selected prime meridian (Figure 2). The coordinates of a point P1 on the sphere in the meridian system are defined as follows. The spherical distance (arcs of a great circle) from the P 1 point to the prime meridian (P 1 F 1 ) is the y value of the P 1 point (y 1 = P 1 F 1 ).
The distance of the perpendicular point F 1 to the starting point P o on the prime meridian also gives the x coordinate (x1 = P o F 1 ). The starting point of P o can also be taken on the equator.  Figure 2 becomes the pole of the prime meridian circle. So it is always OF 1 = OF 2 = OP o = π/2. In the Soldner coordinate system, the reference direction of the bearing angles of the sides is the parallel y=constant circle drawn to the prime meridian at that point ( Figure-2). The prime meridian determines the Soldner system. Each meridian system creates a separate coordinate system. The ordinates of the points (y) to the left of the prime meridian are negative. Likewise, the abscissas of points (x) below the starting point take negative values. The azimuth angle is used for the direction values of the sides in main problem solutions with geographical coordinates. The azimuth angle (A 12 , A 21 ) is the angle from the north wing of the meridian at a point to the clockwise side (Fig. 2).
The bearing angle is used for the direction values of the sides in main problem solutions with Soldner coordinates meridian system. The bearing angle (α12, α21) is from the north wing of the parallel to the prime meridian at a point to the clockwise side (Fig. 2). There is a meridian convergence ( γ ) between bearing and azimuth angle (Fig. 3). Meridian convergence can be easily calculated from the geographic or Soldner coordinates of the point. If the bearing angle (α) is given, it is converted to the azimuth angle by using the meridian convergence at that point For example, γ 1 meridian convergence on the P 1 point tan γ1 = sin φ1 tan( λ 1 -λ prime ) from geographic coordinates (11) tan 1 = 1 1 from Soldner coordinates (12) Reciprocal angles between two points whose coordinates are given in geodesy are obtained by solving the inverse (second) geodetic problem. Classically, the reciprocal bearing angles (α12, α21) from two points whose Soldner coordinates P 1 (y 1 , x 1 ), P 2 (y 2 , x 2 ) are given obtained from the following formulas (Fig. 4). Solving P 1 P 2 O spherical triangle α 12 = arctan ( ) The bearing angle values found from the classical formula need to be examined. According to the quarter where the angle is located, the additions in the Table 2 below should be made. The following values of I, II and III are calculated to find the direct bearing angle without examining the sphere surface.
The given formulas in Equation 20 and Equation 21 do not work if the denominator equals zero. The program will be interrupted because division by zero is done. This problem also arises in the use of classical formulas. In order not to interrupt the program, very small numbers are added to the numerator and denominator at a rate that will not affect the result. If μ1=1E -15,... μ2 =1E -27 are selected, ten-digit sensitive bearing angle values are obtained. The division by zero error will be avoided if the following formulas Equation 22

Numerical Example
In order to show the validity of the given formulas, numerical applications were made separately in the east and west of Greenwich in both the northern and southern hemispheres. Inverse problem was solved between twenty-point pairs in total. The radius of the earth is taken as R=6370000m, the prime meridian is taken as λ prime =30 o to the east of Greenwich and λ prime = -30 o to the west of Greenwich. In numerical applications (Y, X) Soldner coordinates and (γ) meridian convergences of twenty-point pairs are calculated whose (φ, λ) geographic coordinates are given. Then, the bearing (α) and the azimuth angles (A) calculations were made separately with direct formulas. In order to control between the bearing and azimuth angles, the azimuth angle was found by adding the meridian convergence to the bearing angle (A ij =α ij +γ i ) between each pair of points. Numerical application results can be seen in Table 3.

Results and discussion
In this study, formulas are given for how to obtain the bearing and the azimuth angle directly without any examination. The numerical examples also show no loss of precision in the use of direct formulas. It has been observed that the classical formulas (Equations 1, 2, 14, and 15) and the formulas we propose (Equations 6,7,20,and 21) give the same results in the calculations made with ten digits after the decimal point. It is suggested to use Equations 8, 9, 22, and 23) to avoid division by zero error. The advantage of the method is that no examination is required. In computer calculations, if…, then..., end…, blocks are not used when direct formulas are used. The if..., then…, end…, blocks reduce the execution speed in computer calculations.
The classical formulas and the direct formulas we proposed were compared in terms of processing time. All were coded in MATLAB. The main characteristics of the hardware were Windows 10 Pro, Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz, 6 GB of RAM.
The same bearing and the same azimuth angle were calculated 500 million times and the processing times are shown in Table 4 below. It has been observed that the processing time is slightly shorter in the direct formulas we recommend. This is because classical formulas need quadrant comparison.

Conclusion
In this proposed method, formulas are given for how to obtain the bearing and azimuth angle directly without any examination. The need for comparison in classical formulas increases both the processing time and the possibility of error. Direct formulas are always more useful. While saving time on the one hand, the probability of making mistakes will also be seriously reduced on the other hand. We hope that the accuracy and non-examination of the direct formulas we proposed will increase the usability of our formulas. The formulas on the sphere surface, which are used to calculate the direct bearing and azimuth, can also be adapted to the ellipsoid surface. For future studies, researchers are advised to find more simple direct formulas.