# Analytical Attitude Guidance Planner for Multiple Ground Targets Acquisitions
## 4 Attitude Point-to-Point Generator
Specifically, the expression \(a_{i2}=-(\dot{\omega}_{i0}+3a_{i3}t_{f_{1}}^{2})/2t_{f_{1}}\) (carried out from \(3a_{i3}t_{f_{1}}^{2}+2a_{i2}t_{f_{1}}+\dot{\omega}_{i_{0}}=0\)) can be included in \(a_{i3}t_{f_{1}}^{3}+a_{i2}t_{f_{1}}^{2}+a_{i1}t_{f_{1}}+\omega_{i_{0}}=0\):  
\[a_{i3}t_{f_{1}}^{3}-\frac{\dot{\omega}_{i0}t_{f_{1}}+3a_{i3}t_{f_{1}}^{3}}{2} +\dot{\omega}_{i0}t_{f_{1}}+\omega_{i_{0}}=0\to a_{i3}=(2\omega_{i 0}+\dot{\omega}_{i0}t_{f_{1}})/t_{f_{1}}^{3}. \tag{17}\]  
By substituting the expression of \(a_{i3}\) in Equation (17) in \(a_{i2}=-(\dot{\omega}_{i0}+3a_{i3}t_{f_{1}}^{2})/2t_{f_{1}}\), the expression of \(a_{i2}\) as a function of \(t_{f_{1}}\) is found as  
\[a_{i2}=-\frac{\dot{\omega}_{i0}}{2t_{f_{1}}}-\frac{6\omega_{i0}+3\dot{\omega} _{i0}t_{f_{1}}}{2t_{f_{1}}^{2}}=-\frac{3\omega_{i0}+2\dot{\omega}_{i0}t_{f_{ 1}}}{t_{f_{1}}^{2}}. \tag{18}\]  
Hence, the four polynomial coefficients of the \(i^{th}\) angular velocity component are obtained as a function of the final time \(t_{f_{1}}\) and the corresponding boundary conditions:  
\[ \begin{cases}a_{i0}=\omega_{i0}\\ a_{i1}=\dot{\omega}_{i0}\\ a_{i2}=-(3\omega_{i0}+2\dot{\omega}_{i0}t_{f_{1}})/t_{f_{1}}^{2}\\ a_{i3}=(2\omega_{i0}+\dot{\omega}_{i0}t_{f_{1}})/t_{f_{1}}^{3}.\end{cases}  \tag{19}\]  
The final time \(t_{f_{1}}\) of the polynomial is a free parameter and must be selected in order to calculate the coefficients \(a_{i2}\) and \(a_{i3}\), defining a trajectory matching the constrain conditions (Equations (4) and (9)). Even though it is feasible at the boundaries, the guidance must be verified to check that the maximum or the minimum values of \(\omega_{i}(t,t_{f_{1}})\) and \(\dot{\omega}_{i}(t,t_{f_{1}})\) are less than or equal to the allowed limits. The time \(t_{\omega_{max}}\) at which \(\omega_{i}(t)\) attains its extreme value is evaluated by imposing \(\dot{\omega}_{i}(t)\) equal to zero, thus having  
\[t_{\omega_{max}}^{II}=\frac{-a_{i2}\pm\sqrt{a_{i2}^{2}-3a_{i3}a_{i1}}}{3a_{i3}}. \tag{20}\]  
Using Equation (19) in Equation (20), the two solutions are  
\[t_{\omega_{max}}^{II}=\frac{((3\omega_{i0}+2\dot{\omega}_{i0}t_{f_{1}})\pm(3 \omega_{i0}+\dot{\omega}_{i0}t_{f_{1}}))t_{f_{1}}}{6\omega_{i0}+3\dot{\omega}_ {i0}t_{f_{1}}}\to \begin{cases}t_{\omega_{max}}^{II}=t_{f_{1}}\\ t_{\omega_{max}}^{II}=\frac{\dot{\omega}_{i0}t_{f_{1}}^{2}}{6\omega_{i0}+3 \dot{\omega}_{i0}t_{f_{1}}}\end{cases}  \tag{21}\]  
The \(t_{\omega_{max}}^{I}\) solution is the imposed boundary condition, while \(t_{\omega_{max}}^{II}\) provides the required information. Referring to \(t_{\omega_{max}}^{II}\) as \(t_{\omega_{max}}\), where the subscript \(1\) stands for the _first step_, the condition \(|\omega_{i}(t=t_{\omega_{max}}{}_{1})|\leq\omega_{max}\), which is an expression depending the free parameter \(t_{f_{1}}\), must be verified. The same approach can be exploited to find the condition for which \(\dot{\omega}_{i}(t)\) reaches its maximum value. Indeed, by imposing \(\dot{\omega}_{i}(t)=0\) one can obtain \[t_{\dot{\omega}_{max}}=-\frac{a_{I2}}{3a_{I3}}=\frac{(3\omega_{I_{0}}+2\dot{\omega} _{b}t_{f_{1}})}{(2\omega_{I_{0}}+\dot{\omega}_{I_{0}}t_{f_{1}})}\,\frac{t_{f_{1} }}{3}. \tag{22}\]  
The condition \(|\dot{\omega_{i}}(t=t_{\dot{\omega}_{max}})|\leq\dot{\omega}_{max}\) depending on the parameter \(t_{f_{1}}\) must be verified. Finally, referring to \(t_{\dot{\omega}_{max}}\) as \(t_{\dot{\omega}_{max_{1}}}\), the value of \(t_{f_{1}}\) is chosen to satisfy the constraints  
\[ \begin{cases}|\omega_{i}(t=t_{\omega_{max_{1}}})|\leq\omega_{max},\\ |\dot{\omega}_{i}(t=t_{\dot{\omega}_{max_{1}}})|\leq\dot{\omega}_{max},\quad i= x,y,z,.\end{cases}  \tag{23}\]  
In particular, from Equation (23), \(t_{f_{1}}\) is evaluated in order to maximize one condition without exceeding the other one. The analytical procedure will be described in detail in the next section.