## 3 Node Clustering for WMSNs
### Overlapping Areas between FoV of Multimedia Nodes  
It is obvious that there is no overlap between FoV of two nodes if the Euclidean distance between them is more than 2\(\mathrm{R_{S}}\). Otherwise, it is possible to have overlapped regions between their FoV depending on the orientation angles \(\alpha\). For calculating the FoV overlapping area of two nodes, we first survey the intersection of triangles that are representatives of their FoVs. Second, if they intersect each other, we find the intersection polygon and at last, compute the area of the polygon. An example of the intersection polygon of two FoV belonging to nodes A = (\(\mathrm{x_{A}}\),\(\mathrm{y_{A}}\)) with orientation \(\alpha_{1}\) and B = (\(\mathrm{x_{B}}\),\(\mathrm{y_{B}}\)) with orientation \(\alpha_{2}\) is illustrated in Figure 2.  
For this purpose, in the first step, we define the equations of the sides of each triangle using the vertex coordinates of each triangle. The coordinates of the main vertex A (Figure 1) are known according to the location of the node in space. The coordinates of vertex \(\mathrm{P_{1}}\) and \(\mathrm{Q_{1}}\) are:  
\[\mathrm{x_{p_{1}}}=\mathrm{x_{A}}+\mathrm{R_{S}}\cdot\cos(\alpha) \tag{1}\]  
Figure 1: FoV of a multimedia sensor. \[y_{{}_{P_{1}}}=y_{{}_{A}}+R_{{}_{S}}\cdot\sin\left(\alpha\right) \tag{2}\]  
\[x_{{}_{Q_{1}}}=x_{{}_{A}}+R_{{}_{S}}\cdot\cos\left(\left(\alpha+\theta\right) \mathrm{mod}\ \ 2\pi\right) \tag{3}\]  
\[y_{{}_{Q_{1}}}=y_{{}_{A}}+R_{{}_{S}}\cdot\sin\left(\left(\alpha+\theta\right) \mathrm{mod}\ \ 2\pi\right) \tag{4}\]  
We can determine the equation of a line from the coordinates of two points of the line or from the coordinates of one point and the gradient of the line. Thus, using the coordinates of A, P\({}_{1}\) and Q\({}_{1}\), we can determine the equations of the three sides of the FoV triangle:  
\[\overline{P_{i}Q_{i}};\ y-y_{{}_{P_{1}}}=\frac{y_{{}_{Q_{i}}}-y_{{}_{P_{1}}}} {x_{{}_{Q_{1}}}-x_{{}_{P_{1}}}}.\left(x-x_{{}_{P_{1}}}\right) \tag{5}\]  
\[\overline{AP_{i}};\ y-y_{{}_{A}}=\left(x-x_{{}_{A}}\right)\cdot\tan\left( \alpha\right) \tag{6}\]  
\[\overline{AQ_{i}};\ y-y_{{}_{A}}=\left(x-x_{{}_{A}}\right)\cdot\tan\left( \left(\alpha+\theta\right)\mathrm{mod}\ \ 2\pi\right) \tag{7}\]  
In the second step, we calculate the intersection of each side of each triangle to all sides (_i.e._, the perimeter) of the other triangle. An intersection point V of two lines representing two sides of the FoVs will be a vertex of the overlapped polygon if it lies among the vertices associated with those two sides. As illustrated in Figure 2, the line representing AP\({}_{1}\) of the FoV of node A intersects the line that represents BP\({}_{2}\) of the FoV of node B in point V\({}_{1}\). V\({}_{1}\) can be considered as a vertex of the intersection polygon because V\({}_{1}\) is located between A and P\({}_{1}\) and also between B and P\({}_{2}\). The desired condition (C\({}_{\mathrm{ACCEPT}}\)) for an intersection point V to be an acceptable vertex of the polygon is stated in Equation (8). Figure 2: An example of the intersection polygon of two FoVs, (V\({}_{1}\)V\({}_{2}\)...V\({}_{6}\)). This subject is noticeable because any two anti-parallel lines obviously have an intersection point in a two dimensional space. On the other hand, each side of a FoV is a segment of a line. Figure 3 shows examples of non-acceptable intersection points:  
\[\mathrm{x_{p_{1}}}=\mathrm{x_{A}}+\mathrm{R_{S}}\cdot\cos(\alpha) \tag{1}\]0  
The intersection of each side of one triangle with all sides of another triangle consists of at most two points.