# UWB-Based Real-Time Indoor Positioning Systems: A Comprehensive Review
## 3 UWB Positioning System
### UWB Positioning Techniques and Algorithms
#### 3.1.2 Trilateration Technique  
The trilateration technique depends on calculating the distances between the moving tag and the fixed anchors. The distance is calculated by multiplying the time of wave propagation (ToF) by the speed of the UWB wave, which is approximately (\(3\times 10^{8}\) m/s). If the coordinates of the used anchors (which are predefined by the user) and the distances between the movable objects and anchors can be provided by the used technology, then we can find and track the object location using trilateration techniques.  
The distance d between any two points can be calculated with the known coordinates \((x,y)\) of the two points; for example, the distance between \((x_{1},y_{1})\) and \((x_{2},y_{2})\) is  
\[d=\sqrt{(x_{2}-x_{1})^{2}+(y_{2}-y_{1})^{2}} \tag{5}\]  
If the tag coordinates are \((x_{t},\ y_{t})\) and the anchor coordinates are \((x_{a},\ y_{a})\), we can rewrite the equation as follows:  
\[d_{a}^{2}=(x_{a}-x_{t})^{2}+(y_{a}-y_{t})^{2}\]  
\[d_{a}^{2}=x_{a}^{2}+x_{t}^{2}-2x_{a}x_{t}+y_{a}^{2}+y_{t}^{2}-2y_{a}y_{t} \tag{6}\]  
when a point \((r)\) is considered as a reference point for the IPS and used to fix an anchor with the coordinates \((x_{r},\ y_{r})\), and the remaining anchors have the coordinates \((x_{i},\ y_{i})\), where \(i\) represents the anchor number. Subtracting the \(d_{r}\) from \(d_{i}\) results i:  
\[d_{r}^{2}-d_{i}^{2}+x_{i}^{2}+y_{i}^{2}-x_{r}^{2}-y_{r}^{2}=2(x_{i}-x_{r})x_{ t}+2(y_{i}-y_{r})y_{t} \tag{7}\]  
With \(r=1\) and \(a=2\),\(3\),... (\((i)\) represents all of the used anchors), we obtain  
\[\begin{bmatrix}2(x_{2}-x_{1})&2(y_{2}-y_{1})\\ 2(x_{3}-x_{1})&2(y_{3}-y_{1})\end{bmatrix}\begin{bmatrix}x_{t}\\ y_{t}\end{bmatrix}=\begin{bmatrix}d_{1}^{2}-d_{2}^{2}+x_{2}^{2}+y_{2}^{2}-x_{ 1}^{2}-y_{1}^{2}\\ d_{1}^{2}-d_{3}^{2}+x_{3}^{2}+y_{3}^{2}-x_{1}^{2}-y_{1}^{2}\end{bmatrix} \tag{8}\]  
By representing Equation (8) by the linear system equation \((Ax=b)\), \(x\) will be the coordinate of the movable tag \((x_{t},\ y_{t})\), which can be processed and monitored using a proper positioning algorithm and monitoring program. Figure 4 explains the structure of the trilateration technique for a three-anchor IPS.  
The great industrial development and the effective introduction of robots into production processes has coincided with the need for three-dimensional (3D) positioning systems. These systems differ from the common two-dimensional systems in the need to calculate the height (\(h\)) of the moving tag in addition to the (\(x,y\)) coordinates (see Figure 5). Some 3D positioning systems require an additional anchor fixed at a different height than the rest of the IPS anchors to measure the height of the moving tags. From Equation (8), if we suppose that the number of the anchors used in the system is (\(i\)), we can calculate the 3D position coordinates of the movable tag (\(x_{t},\ y_{t},\ h_{t}\)) as follows:  
\[\begin{bmatrix}2(x_{2}-x_{1})&2(y_{2}-y_{1})&2(h_{2}-h_{1})\\ 2(x_{3}-x_{1})&2(y_{3}-y_{1})&2(h_{3}-h_{1})\\ \vdots&\vdots&\vdots\\ 2(x_{i}-x_{1})&2(y_{i}-y_{1})&2(h_{i}-h_{1})\\ \end{bmatrix}\begin{bmatrix}x_{t}\\ y_{t}\\ y_{t}\\ h_{t}\end{bmatrix}=\begin{bmatrix}d_{1}^{2}-d_{2}^{2}+x_{2}^{2}+y_{2}^{2}+h_{2} ^{2}-x_{1}^{2}-y_{1}^{2}-h_{1}^{2}\\ d_{1}^{2}-d_{3}^{2}+x_{3}^{2}+y_{3}^{2}+h_{3}^{2}-x_{1}^{2}-y_{1}^{2}-h_{1}^{2 }\\ \vdots\\ d_{1}^{2}-d_{i}^{2}+x_{i}^{2}+y_{i}^{2}+h_{i}^{2}-x_{1}^{2}-y_{1}^{2}-h_{1}^{2 }\\ \end{bmatrix} \tag{9}\]  
Figure 4: Trilateration IPS positioning technique.  
Figure 5: Multilateration positioning technique in a 3D environment.