# Difference DV_Distance Localization Algorithm Using Correction Coefficients of Unknown Nodes
## 4 Our Proposal: Difference DV_Distance Using Correction Coefficients of Unknown Nodes
### Calculation of Correction Coefficients for Direction Anchor Node  
Unknown nodes do not contain their position information, so the actual Euclidean distances from unknown nodes to anchor nodes are also unknown. Therefore, we put forward an indirect calculation approach for the distance difference from unknown nodes to anchor nodes. Figure 3 shows the calculation schematic diagram of correction coefficients of unknown nodes, node \(p\) is set as an unknown node, and node \(i\) is indicated as target anchor node. Both the accumulated hop distance and the hop number from unknown node \(p\) to target anchor \(i\) are already known. However, the correction coefficient of unknown node \(p\) cannot be computed only using the above two known information, and thus, we can make full use of the information from direction anchor nodes \(k\), \(m\), and \(n\). Taking direction anchor node \(k\) as an example, because the actual Euclidean distance, accumulated hop distance and hop number from direction anchor node \(k\) to target anchor node \(i\) are already known, we can calculate the corresponding correction coefficient for direction anchor node \(k\) using the information from both unknown node \(p\) and direction anchor node \(k\) to target anchor node \(i\). Similarly, the correction coefficients of other direction anchor nodes can also be obtained sequentially. The calculation equation is as follows:  
\[C_{p,i}^{k}=Pc_{p,i}^{k}.\frac{(d_{k,i}-D_{k,i})/h_{k,i}}{D_{k,i}} \tag{15}\]  
where \(C_{p,i}^{k}\) is the correction coefficient for direction anchor node \(k\) from unknown node \(p\) to target anchor node \(i\); \(D_{k,i}\) represents the actual Euclidean distance from direction anchor node \(k\) to target anchor node \(i\); \(d_{k,i}\) and \(h_{k,i}\), respectively indicate the corresponding accumulated hop distance and the hop number. In addition, \(Pc_{p,i}^{k}\) is the projection parameter of direction anchor node \(k\). From Equation (15), it can be seen that the correction coefficient \(C_{p,i}^{k}\) for direction anchor node \(k\) is composed of two parts. In the equation, \(\frac{\left(d_{k,i}-D_{k,i}\right)/h_{k,i}}{D_{k,i}}\) indicates the distance difference per hop under unit distance from direction anchor node \(k\) to target anchor node \(i\), and this distance difference can be projected by the remaining part \(Pc_{p,i}^{k}\) onto the direction from unknown node \(p\) to target anchor node \(i\). Therefore, the correction coefficients for the other direction anchor nodes can be computed using the same way. The projection parameter \(Pc_{p,i}^{k}\) can be calculated as follows:  
\[Pc_{p,i}^{k}=\left|\cos(angle)\right|^{\frac{h_{p,k}}{h_{p,i}+h_{p,k}}} \tag{16}\]  
where \(h_{p,k}\) and \(h_{p,i}\), respectively represent the hop number from the unknown node \(p\) to direction anchor node \(k\) and target anchor node \(i\), and \(angle\) can be computed in Equation (17) based cosine theorem. Figure 3: Calculation schematic diagram of correction coefficient. \[angle=\cos^{-1}\left(\frac{d_{p,i}^{2}+d_{k,i}^{2}-d_{p,k}^{2}}{2\cdot d_{p,i} \cdot d_{k,i}}\right) \tag{17}\]  
where \(d_{p,i}\) and \(d_{p,k}\), respectively indicate the accumulated hop distance from unknown node \(p\) to target anchor \(i\) and direction anchor \(k\). For the Equation (17), a triangle can be formed by unknown node \(p\), target anchor node \(i\) and direction anchor node \(k\). because we do not have the coordinates of unknown node \(p\), and thus the actual Euclidean distances between them can be approximately replaced by the corresponding accumulated hop distances. When the _angle_ is 0 degree, it indicates that the shortest path from direction anchor node \(k\) to target anchor node \(i\) passes through the unknown node \(p\). However, when the angel is 180 degree, it shows that the shortest path from unknown node \(p\) to direction anchor node \(k\) passes through target anchor node \(i\). For the Equation (16), \(Pc_{p,i}^{k}\) can be treated as the exponential function about the absolute cosine value of _angle_.