## 2 Orientation and Localization Equations
### Position Determination
Therefore, in a first step, \(S\) is determined:  
\[S=\pm\sqrt{a+jb}\pm\sqrt{a-jb}=\pm\sqrt{r}\,e^{j\frac{\pi}{2}}\pm \sqrt{r}\,e^{-j\frac{\pi}{2}}\] \[\qquad=\pm 2\sqrt{r}\,\frac{1}{2}(e^{j\frac{\pi}{2}}+e^{-j\frac{ \pi}{2}})=\pm 2\sqrt{r}\,cos\frac{\varphi}{2}.\]  
The square root addends in Equation (18) represented by \(S\) can now be replaced by this result, leading to:  
\[y_{1,2}=\frac{S}{2P^{2}}+\frac{CV_{z}}{P^{2}}=\frac{1}{P^{2}}\left(\pm\sqrt{r }\,cos\frac{\varphi}{2}+CV_{z}\right), \tag{21}\]  
with \(r\) and \(\varphi\) according to (20). **Theorem 2**. : _There exist two solutions \(|y_{1}|\
eq|y_{2}|\). One each is in \(y<0\) and \(y>0\), respectively._  
Proof. : The hypothesis is true if the absolute value of the square root addends in Equation (18) is always greater than \(C|V_{z}|P^{-2}\). \[\frac{|\pm(\sqrt{a+jb}+\sqrt{a-jb})|}{2P^{2}} \Rightarrow|(\sqrt{a+jb}+\sqrt{a-jb}\,)|^{2}>(2C|V_{z}|)^{2}\] \[\Rightarrow q_{l}=\sqrt{a+jb}\sqrt{a-jb}>2C^{2}V_{z}^{2}-a=q_{r}.\]  
Further, with \(a,b\) from (19), it follows for the left and right side:  
\[q_{l}= P^{8}y_{0}^{4}+(4C^{2}P^{4}V_{z}^{2}-2C^{2}P^{6})y_{0}^{2}+C^{4}P^{4},\] \[q_{r}= P^{8}y_{0}^{4}-2C^{2}P^{6}y_{0}^{2}+C^{4}P^{4},\] \[\Rightarrow q_{l}-q_{r}=4C^{2}P^{4}V_{z}^{2}y_{0}^{2}>0.\]  
(II) \(V_{y}=0\quad\Rightarrow\quad P=|V_{z}|\): In this case, the excluded complex solutions must also be considered, since they become real. Both give the same result \(y_{3}\). The two real solutions \(y_{1,2}\) can again be obtained from (21) or from the general Equation (18). \[y_{1,2}=\frac{1}{V_{z}^{2}}(\pm\sqrt{V_{z}^{4}y_{0}^{2}+C^{2}V_{z}^{2}}+CV_{z} ),\quad y_{3}=\frac{C}{V_{z}} \tag{22}\]  
\(|y_{1}|\
eq|y_{2}|\
eq|y_{3}|\). One of the solutions lies in the opposite half plane. (III) \(V_{z}=0\quad\Rightarrow\quad P=|V_{y}|\): The solutions are obtained analogous to Case (II). \(|y_{1}|=|y_{2}|\). \[y_{1,2}=\pm\frac{\sqrt{y_{3}^{4}y_{0}^{2}-C^{2}V_{y}^{2}}}{V_{y}^{2}},\quad y _{3}=0 \tag{23}\]  
(IV) \(V_{y}=V_{z}=0\): If this case occurs, the sensor lies exactly in the origin of the global frame. Once the corresponding \(y\) is determined, in a final step, \(z\) can be calculated from Equation (16):  
\[\qquad=\pm 2\sqrt{r}\,\frac{1}{2}(e^{j\frac{\pi}{2}}+e^{-j\frac{ \pi}{2}})=\pm 2\sqrt{r}\,cos\frac{\varphi}{2}.\]0  
offering four possible \(z\)-solutions, all of which can be real-numbered. There are also situations where, for a given \(y\), a subset of the \(z\)-solutions in (24) can become complex. Therefore, their use must be treated with caution, especially when the formulas are implemented on a microcontroller of a real UAV. A safer way is to check the arguments of the square roots. The argument of the outer square root can be written as:  
\[\qquad=\pm 2\sqrt{r}\,\frac{1}{2}(e^{j\frac{\pi}{2}}+e^{-j\frac{ \pi}{2}})=\pm 2\sqrt{r}\,cos\frac{\varphi}{2}.\]1  
where \(g\) is the inner square root expression. For all solutions \(y_{1,2,3}\) obtained, \(g\geq 0\) holds, since they were obtained using the \(z^{2}\)-expression (16). Thus, the argument of the inner square root does not need to be checked. In contrast, \(A_{o}\) can become negative in general and should be checked to satisfy that the condition \(A_{o}>0\) is fulfilled before applying the square root.