## 2 Threat Environment Model
### Terrain and UAV Performance Constraints  
In UAV path planning, it is additionally imperative to guide the UAV to safely pass the threats triggered using obstacles. Let \(K\) be the set of all threats and every threat be represented by way of a cylinder. As shown in Figure 1, let the projected middle coordinate of the obstacle be \(C_{k}\) and the radius be \(R_{k}\). Due to the notably small dimension of the UAV, most research approximates the UAV as a particle. To make the threat cost of the UAV more accurate, the size of the UAV is considered here, the diameter of the UAV is set as \(D\), and \(d_{k}\) is the distance between the UAV and \(C_{k}\). Given a path segment \(\parallel\overrightarrow{P_{ij}P_{i,j+1}}\parallel\), by way of thinking about the diameter \(D\) of the drone and the hazard distance \(S\) from the danger zone to the collision zone, calculate the threat cost \(F_{2}\) at waypoint \(P_{ij}\):  
\[\left\{ \begin{array}{l}F_{2}(X_{i})=\sum\limits_{j=1}^{n-1}\sum\limits_{k=1 }^{K}T_{k}(\overrightarrow{P_{ij}P_{i,j+1}})\\ T_{k}(\overrightarrow{P_{ij}P_{i,j+1}})=\begin{cases}0&d_{k}>S+D+R_{k}\\ (S+D+R_{k})-d_{k},&D+R_{k}<d_{k}\leq S+D+R_{k}\\ \infty&d_{k}\leq D+R_{k}\end{cases}\end{array} \right. \tag{2}\]  
Due to the running environment, positioning accuracy, and different reasons, the UAV nonetheless has the possibility of colliding with obstacles, so the distance from the collision area \(S\) is known as the danger zone. For example, in a static surrounding with excellent  
Figure 1: Threat. positioning signals, \(S\) can be chosen as several tens of meters, and in the case of shifting objects or weak positioning signals, \(S\) can be chosen as several hundred meters. The flight height of the UAV is usually constrained between two given height extremes, namely the maximum height and the minimum height. Let the minimal height be \(h_{\text{min}}\) and the most height be \(h_{\text{max}}\), then the height cost related to the waypoint \(P_{ij}\) is calculated as follows:  
\[H_{ij}=\left\{ \begin{array}{l}\left|h_{ij}-\frac{(h_{\text{max}}+h_{\text{ min}})}{2}\right|,h_{\text{min}}\leq h_{ij}\leq h_{\text{max}}\\ \infty,\quad\quad\text{otherwise}\end{array} \right. \tag{3}\]  
Here \(h_{ij}\) is the flying height of the drone relative to the ground, and \(H_{ij}\) is acquired according to (3), maintaining the average height and penalizing the out-of-range values. So the altitude cost can be expressed as:  
\[F_{3}(X_{i})=\sum_{j=1}^{n}H_{ij} \tag{4}\]  
The assessment of the smoothing cost needs to calculate the turning angle and the climbing angle. As shown in Figure 2, the turning angle \(\ket{\varphi_{ij}}\) is the angle between \(\overrightarrow{P_{ij}^{\prime}P_{i,j+1}}\) and \(\overrightarrow{P_{i,j+1}^{\prime}P_{i,j+2}}\) between the two line segments projected on the surface Oxy, and let \(\overset{\rightarrow}{k}\) be the unit vector on the z-axis, The projected vector can be calculated as:  
\[\overrightarrow{P_{ij}^{\prime}P_{i,j+1}}=\overset{\rightarrow}{k}\times( \overrightarrow{P_{ij}P_{i,j+1}}\times\overset{\rightarrow}{k}) \tag{5}\]  
So, the turning angle is calculated as:  
\[\varphi_{ij}=\arctan(\frac{\|\overrightarrow{P_{ij}^{\prime}P_{i,j+1}} \times\overrightarrow{P_{i,j+1}^{\prime}P_{i,j+2}}^{\prime}\|}{\overrightarrow {P_{ij}^{\prime}P_{i,j+1}^{\prime}}\cdot\overrightarrow{P_{i,j+1}^{\prime}P_{ i,j+2}}}) \tag{6}\]  
Figure 2: Turning and climbing angle calculation. The climb angle is the angle between the UAV's ascent trajectory and the horizontal line; that is, the climb angle \(\psi_{ij}\) refers to the angle between the path segment \(\overrightarrow{P_{ij}P_{i,j+1}}\) and its projection \(\overrightarrow{P_{ij}P_{i,j+1}}^{\prime}\) on the horizontal plane.