## 2 System and Problem Formulation  
In this paper, we consider a 3D Cartesian coordinate system for FSO communication networks, as shown in Figure 1. A laser source (LS) as a transmitter aims to communicate with a photodetector (PD) receiver through a Gaussian laser beam. Furthermore, a UAV carries the RIS as a reflecting platform. We assume that the UAV could acquire the needed information in our scenario, such as the position of and PD [32]. We also assume that there is no direct link between the LS and PD, and the LS is located at the origin point at \(O(0,0,0)\), and consider a PD has a circular detection aperture with radius \(a\) and the center of the PD is located at \(S(x_{s},y_{s},0)\). For practical consideration, we assume the beam is affected by fog, which means the atmospheric conditions vary during the beam propagation. We model a fog that can severely affect the system's Channel State Information (CSI), and treat fog as a spherical entity with radius \(r_{f}\) for the sake of simplicity and initial simulations [33] (Note: In the 'Optimization Results' of this paper, we address the fog in irregular shape for practical thinking and present corresponding results), located at \(F(x_{f},y_{f},z_{f})\) (Note: It should be noted that the UAV's ability to ascertain the location of fog is facilitated by certain technologies and methods. These can include meteorological data services, onboard atmospheric sensors, or advanced imaging techniques [34; 35]). To satisfy the aiming conditions from LS to PD via RIS, we assume that the rotations of the LS can keep tracking the UAV (Note: The details of the laser tracking and aiming method can be achieved by using precise pointing, acquisition and tracking technology [36], we assume the UAV is deployed and control by other ground station to operate the communication task in this area, This paper does not consider the orientation of the UAV because the phase shift change caused by the orientation of the UAV can be added to the optimal phase shifts of the RIS once we know the flight orientation of the UAV). Moreover, we assume the area of the RIS is big enough to cover the beam footprint from the LS [37]. Due to the laser beam following the specular reflection with the RIS, this perspective is central to our methodology as the reflective properties of the RIS allow it to direct the path of light, we consider the status of RIS instead of UAV and introduce the concept of leading angles, which stand for the rotation status of RIS. As shown in Figure 2, the leading angles can be expressed by \(\theta_{1}\) and \(\theta_{2}\), which stand for the rotations along the \(x\)-axis and \(y\)-axis with counterclockwise direction. This approach integrates the UAV status information such as the Angle of Arrival (AoA) of the UAV into the leading angles of the RIS. Therefore, the phase shifts of the RIS at the \(n\)th time slot can be set as  
\[\Theta[n](\theta_{1}[n],\theta_{2}[n])\in(-\pi,\pi). \tag{1}\]  
We consider the 3D flight operation for the UAV with the \(n\)th time slot, \(n\in\{1,2,\ldots,N\}\). The constraints of phase shifts of RIS can be denoted as \(\Phi=\{\Theta[n],n=1,2,\ldots,N\}\). The coordinates of the UAV with time slots are also set as following the positive integer waypoints in the flight zone, which are denoted as \(G[n](x_{g}[n],y_{g}[n],z_{g}[n])\), where \(G[1]\) and \(G[N]\) denote the initial and final positions of the UAV. We set the velocity of the UAV as \(V[n]\) at the \(n\)th time slot, and the maximum and minimum velocity of the UAV are set as \(V_{max}\) and \(V_{min}\), the operation height of the UAV is limited from \(H_{l}\) to \(H_{h}\).