## 2 Orientation and Localization Equations
### Orientation Determination  
In this section, the UAV angles \(\alpha\), \(\beta\), and \(\gamma\) are derived. As will be shown below, the calculation is possible without knowledge of the field equation and the transmission  
Figure 6: Isolines of the magnetic field describing equal power.  
line current. Three magnetometers were considered. For the following analysis, their corresponding equations were set up in matrix notation, where \(0_{3\times 3}\) is a \(3\times 3\) zero matrix:  
\[\begin{pmatrix}\vec{\bar{B}}(\vec{p}_{1})\\ \vec{\bar{B}}(\vec{p}_{2})\\ \vec{\bar{B}}(\vec{p}_{3})\end{pmatrix}=\begin{pmatrix}R_{G}^{L_{a}}R_{L_{u}}^ {L_{1}}&0_{3\times 3}&0_{3\times 3}\\ 0_{3\times 3}&R_{G}^{L_{a}}R_{L_{u}}^{L_{2}}&0_{3\times 3}\\ 0_{3\times 3}&0_{3\times 3}&R_{G}^{L_{a}}R_{L_{u}}^{L_{3}}\end{pmatrix} \begin{pmatrix}\vec{v}_{1}\\ \vec{v}_{2}\\ \vec{v}_{3}\end{pmatrix}. \tag{6}\]  
It is obvious that this system of equations is solvable since the rank of the matrix is nine, which is equal to the number of unknowns. In general, in addition to the three angles, each row provides two unknowns \(y_{i}\) and \(z_{i}\). Now, the UAV's yaw and pitch angles can be calculated directly from the two sensor measurements \(\vec{v}_{l}\) and \(\vec{v}_{n}\) and the zero field property (2). With this and the Cartesian unit vector \(\vec{e}_{x}\), it follows from Equation (6) that:  
\[0=(R_{G}^{L_{a}}R_{L_{u}}^{L_{i}}\,\vec{v}_{i})\cdot\vec{e}_{x},\qquad i=l,n. \tag{7}\]  
Obviously, this equation does not depend on the sensor positions or the choice of their local frames. Thus, they can be located anywhere on the UAV and have any local frame. However, to avoid additional transformations or computational effort, the sensor frames are aligned with the UAV body frame. Then, the equation system (7) becomes:  
\[\begin{array}{llll}0=&c_{\beta}\,c_{\alpha}\,v_{lx}&+c_{\beta}\,s_{\alpha}\, v_{ly}&-s_{\beta}\,v_{tz}\\ 0=&c_{\beta}\,c_{\alpha}\,v_{nx}&+c_{\beta}\,s_{\alpha}\,v_{ny}&-s_{\beta}\,v_ {nz}\end{array} \tag{8}\]  
After division by \(c_{\beta}\) and subsequent subtraction, \(tan\,\beta\) can be eliminated. Solving the remaining equation for \(\alpha\) leads to:  
\[\alpha=atan\left(\frac{v_{lx}v_{nx}-v_{lx}v_{nz}}{v_{ly}v_{nz}-v_{lx}v_{ny }}\right)=atan\left(\frac{(\vec{v}_{l}\times\vec{v}_{n})\cdot\vec{e}_{y}}{( \vec{v}_{l}\times\vec{v}_{n})\cdot\vec{e}_{x}}\right) \tag{9}\]  
and further with \(A=tan\,\alpha\) to:  
\[\beta=atan\left(\frac{v_{nx}+v_{ny}A}{v_{nz}\sqrt{A^{2}+1}}\right)=atan\left( \frac{v_{lx}+v_{ly}A}{v_{lx}\sqrt{A^{2}+1}}\right). \tag{10}\]  
Following the same approach to calculate the roll angle \(\gamma\) by using the zero field property does not lead to any result, since the analytic equation obtained is linearly dependent. The state of the art now is that the roll angle cannot be calculated analytically. On the one hand, it can be calculated numerically using Equation (5), which leads to a very complicated system of equations since it now additionally contains the sensor location, which is unknown. On the other hand, the roll angle can be measured by additional sensors, e.g., by an inertial measurement unit (IMU), which is present in almost all UAVs. In this case, the yaw and pitch angles calculated by Equations (9) and (10) can be used as correction information, since the IMU provides all three angles. For the following considerations in connection with the UAV position calculation, all three angles are assumed to be known, either through calculation or measurement.