## 3 Coverage Calculation Based on the Line of Sight
### Calculation of the Viewhed  
Based on the nine parameters presented in the previous section, a line of sight is constructed for each point in the target area. Then, the viewshed is calculated for the environment where cameras will be placed. Let's consider the following assumptions:  
Figure 3: The parameters used to perform viewshed analysis in ArcGIS 10.1 [29].  
* \(\mathbf{O_{i}}\) (\(\mathbf{x_{i}}\), \(\mathbf{y_{i}}\), \(\mathbf{z_{i}}\)) is the observation point where \"i\" is the index of each observer point, i = 1, 2,..., n. Note that \(\mathbf{z_{i}}=\mathbf{SPOT_{i}}+\mathbf{OF1_{i}}\).
* \(\mathbf{T_{j}}\) (\(\mathbf{x_{j}}\), \(\mathbf{y_{j}}\), \(\mathbf{z_{j}}\)) is the target point where \"j\" is the index of each target, j= 1, 2,..., m. Note that \(\mathbf{z_{j}}=\mathbf{H_{j}}+\mathbf{OF2_{i}}\), where \(\mathbf{H_{j}}\) is the elevation of the surface that corresponds to the Target \(\mathbf{T_{j}}\).
* \(\mathbf{OT_{ij}}\) (\(\mathbf{x_{j}}-\mathbf{x_{i}}\), \(\mathbf{y_{j}}-\mathbf{y_{i}}\), \(\mathbf{z_{j}}-\mathbf{z_{j}}\)) is the line of sight constructed by the Observer \(\mathrm{O_{i}}\) with the index \"i\" and the Target \(\mathrm{T_{j}}\) with the index \"j\". The line of sight distance is written as \(\|\mathbf{OT_{ij}}\|\).  
The viewshely analysis is then performed as follows; a target \(\mathbf{T_{j}}\)_is not visible_ from the Observer \(\mathbf{O_{i}}\) if one of the subsequent conditions is satisfied:  
1. The line of sight \(\mathbf{OT_{ij}}\) between the Observer \(\mathbf{O_{i}}\) and the Target \(\mathbf{T_{j}}\) is obscured by one or many obstacles (Figure 3).
2. The Target \(\mathbf{T_{j}}\) is outside the distance range defined by \(\mathbf{R1_{i}}\) and \(\mathbf{R2_{i}}\) : (\(\|\mathbf{OT_{ij}}\|<\mathbf{R1_{i}}\)) or (\(\|\mathbf{OT_{ij}}\|>\mathbf{R2_{i}}\)).
3. The Target \(\mathbf{T_{j}}\) is outside the horizontal angle range defined by \(\mathbf{AZ1_{i}}\) and \(\mathbf{AZ2_{i}}\) : (\(\mathbf{Arctan((y_{j}-y_{i})/(x_{j}-x_{i}))<AZ1_{i}}\)) and (\(\mathbf{Arctan((y_{j}-y_{i})/(x_{j}-x_{i}))>AZ2_{i}}\)).
4. The Target \(\mathbf{T_{j}}\) is outside the vertical angle range defined by \(\mathbf{VI_{i}}\) and \(\mathbf{V2_{i}}\) : (\(\mathbf{Arcsin((z_{j}-z_{i})/\|OT_{ij}\|)<V1_{i}}\)) and (\(\mathbf{Arcsin((z_{j}-z_{i})/\|OT_{ij}\|)>V2_{i}}\)).
5. If all of these previous conditions (1) to (4) are not satisfied, then the Target \(\mathbf{T_{j}}\)_is visible_ from the Observer \(\mathbf{O_{i}}\).  
Even if the principle of the line of sight analysis is based on a geometric approach, the implementation of the viewshely in GIS software is generally performed on a Digital Surface Model (or Digital Elevation Model) in a raster format [27]. This is due to the huge amount of calculation required to construct a line of sight for each vertex of vector data that represent a large environment. However, it is also possible to generate a viewshely analysis based on the line of sight by using a Triangular Irrigular Network (TIN) as a Digital Model for the target Area [27]. In a 3D GIS, the construction of lines of sight is based on a discrete calculation since it is necessary to specify the 3D objects from which these lines will be constructed. Similarly to vector data, the number of vertices in the 3D objects used in viewshely analysis should be reasonable in order to avoid potential software crashes when calculating all lines of sight.