Manuscript Offprint
arXiv:2610.17511An Optimal Algorithm for Changing from Longitudinal to Latitudinal Formation of Autonomous Aircraft Squadrons
PAULO ANDRÉ S. GIACOMIN, ELDER M. HEMERLY
- Universidade Estadual de Santa Cruz
Departamento de Ciências Exatas e Tecnológicas - Área de Informática
Ilhéus-BA, Brasil
†Instituto Tecnológico de Aeronáutica
Departamento de Sistemas e Controle - Divisão de Engenharia Eletrônica
São José dos Campos-SP, Brasil
Email: pasgiacomin@uesc.br, hemerly@ita.br
Abstract— This work presents an algorithm for changing from longitudinal to latitudinal formation of autonomous aircraft squadrons. The maneuvers are defined dynamically by using a predefined set of 3D basic maneuvers. This formation change is necessary when the squadron has to perform tasks demanding both formations, such as landing, lift-off, obstacle avoidance and georeferencing. The time complexity analysis of the transformation algorithm reveals that its efficiency is optimal. Simulations show that the formation change is done without collision, and the proof of correctness ensures its latitudinal formation features.
Keywords— Algorithms, Intelligent Agents, Multi-agents Systems, Robotics, Simulation
Resumo— Este trabalho apresenta um algoritmo de mudança de formação em longitude para formação latitudinal de esquadrilhas de aeronaves autônomas. As manobras são definidas dinamicamente utilizando-se um conjunto pré-definido de manobras 3D básicas. Esta mudança de formação é necessária quando a esquadrilha tem que desenvolver tarefas que demandam ambas as formações, tais como aterrissagem, decolagem, desvio de obstáculos e georeferenciamento. A análise de complexidade de tempo do algoritmo de transformação revela que sua eficiência é ótima. As simulações mostram que a mudança de formação é feita sem colisão, e a prova de correção assegura suas características de formação latitudinal.
Palavras-chave— Algoritmos, Agentes Inteligentes, Sistemas Multiagentes, Robótica, Simulação
1 Introduction
Recently, it has been possible to see a growing interest in the development of autonomous aircraft that can cooperate with several organizations in the solution of public security problems. Police and army are some examples. This happens because the autonomous agents can deal with unhealthy or dangerous problems, like monitoring of areas with armed conflict, violence monitoring, fires, deforestation monitoring and inspection of nuclear areas, without to expose humans to the risks.
When several agents are used in the solution of these problems, some advantages arise: a) it is possible to make a better use of sensors, since they can be shared by the network, b) distributed systems are usually more robust than the centralized ones. c) autonomous aircraft typically fly at low heights, hence good quality images can be captured, and d) when autonomous aircraft squadrons are used in georeferencing, the visual field of the cameras increases, since the images captured by each aircraft can be mosaicked.
The longitudinal formation presented in Figure 1 is necessary when the squadron is landing and doing lift-off, and can also be used for collision avoidance: if the first aircraft succeeds in avoiding the collision, all other aircraft in the squadron can also avoid the obstacle by using the same behavior.
The latitudinal formation shown in Figure 2 is an attractive formation to deal with the georeferencing problem, since better area coverage can be achieved. Therefore, if the same squadron needs to perform obstacle avoidance, landing, lift-off and georeferencing, it will eventually be necessary for the squadron to change between its longitudinal and latitudinal formations.

Figure 1: The longitudinal formation can be used for collision avoidance, landing and lift-off.
Published in the Proceeding Series of the Brazilian Society of Computational and Applied Mathematics (DINCON 2013); the scientific content remains unchanged. Licence: CC BY-NC-ND. DOI: 10.5281/zenodo.21473681.
Therefore, the problem considered in this work is: assuming that there are n aircraft in longitudinal formation, equally spaced by meters, we want to develop an algorithm that changes the squadron to the latitudinal formation, where the aircraft will also be equally spaced by meters, without collision among them.

Figure 2: It is possible to achieve good area coverage with the latitudinal formation.
This problem is different of the one considered in (Giacomin and Hemerly, 2013a), since the one treated here deals with transition from longitudinal to latitudinal formation, but the one presented in (Giacomin and Hemerly, 2013a) deals with changing from latitudinal to longitudinal formation. Therefore, although apparently similar, the algorithms, sequence of maneuvers, simulation results and theoretical analysis are quite different.
The problem considered here involves control, trajectory generation and aircraft formation. Control techniques, like the reinforcement learning (Santos et al., 2012) do not focus on the changing of formation. Trajectory generation done by using optimization algorithms are usually found in the literature. Some examples are the works of (Cheng et al., 2012) and (Xu et al., 2012), but works like these do not focus on well defined geometric formations. Other techniques are also used in the trajectory definition, like the geometric moments, controlled via nonlinear gradient (Morbidi et al., 2011), the modern matrix analysis used by (Coker and Tewfik, 2011), the combination of the hybrid navigation architecture with the local obstacle avoidance methodology and with the model predictive control (Jansen and Ramirez-Serrano, 2011), the navigation functions (Roussos and Kyriakopoulos, 2012), and the variation of rapidly-exploring random trees (Alves Neto et al., 2010). But they also do not consider the changing between well defined geometric formations during the flight. The formation problem is treated by the nonlinear model predictive control approach of (Chao et al., 2012) and by the leader-follower approach of (You and Shim, 2011) and (Gu et al., 2009), but changing between well defined geometric formations is not considered.
The formation reconfiguration is studied by (Knoll and Beck, 2006), where the aircraft move their position inside a formation, and the same formation is considered before and after the reconfiguration. The autonomous decision-making architecture (Venkataramanan and Dogan, 2004) also considers this problem, but neither (Knoll and Beck, 2006) nor (Venkataramanan and Dogan, 2004) consider the transition between different formations. After exhaustive literature searching, no algorithm was found dealing with the problem considered here. Thus, the main contributions of this work are:
-
An algorithm, adapted from (Giacomin and Hemerly, 2013a), for changing from the longitudinal to the latitudinal formation of the squadron. The time complexity analysis of the proposed algorithm demonstrates that its efficiency is optimal.
-
The simulation results considering a case study in which the aircraft do not collide, and a proof of correctness of the proposed algorithm that ensures its latitudinal formation features.
These contributions are described in the next sections, namely: 2 - Methodology, 3 - Simulation Results, 4 - Theoretical Analysis and 5 - Conclusion.
2.1 The Maneuvers Scheme
Two 3D basic maneuvers are employed by the proposed algorithm, as described in (Giacomin and Hemerly, 2013b). Here they are called C and FW to implement the to-turn and go-forward maneuvers, respectively. The to-turn interface is , and the go-forward interface is , where P is the initial position , T is a vector time to be filled with time intervals, is the angle between the maneuvers and the latitudinal axis in counterclockwise direction, is the spin angle around the longitudinal axis, is the angle between the maneuvers and the longitudinal-latitudinal plane, is the angle of the arc of the to-turn maneuver with radius r, vel is the velocity of the maneuvers and d is the distance of the go-forward maneuver. The angles , and are applied firstly by using the coordinate system base , and after the maneuver is translated to the base .
The C and FW algorithms are used by the transition algorithm described at Subsection 2.2.
2.2 The Transition Algorithm
The transition algorithm is shown in Algorithm 1. It is called FOTLA due to the initial characters that describe its function: From Longitudinal To Latitudinal formation. It basically performs the maneuvers presented in Figure 3, and the equivalent mirrored ones, with each aircraft moving to the left and to the right of the squadron, respectively.

Figure 3: An aircraft goes out from the middle line when it assumes the latitudinal formation.
The interface of the transition algorithm is FOTLA(i, , vel, r, , , P), where P is the aircraft initial position ( ), and have the same meaning that in the previously described C and FW interfaces, r is the radius of the to-turn maneuvers used by the transition algorithm, vel is the aircraft airspeed, and i is the aircraft index shown in Figures 1 and 2.
Algorithm 1 is executed by each aircraft processor in parallel. Each aircraft executes four maneuvers. The values that are determined between Lines 7 and 15 are used to fit each maneuver with the next one.
Each aircraft goes out from the middle line of the squadron between Lines 17 and 21. At Line 34, the aircraft increases the diagonal distance from the middle line of the squadron. Between Lines 36 and 41, the aircraft moves to assume the latitudinal position. Finally, for all aircraft, except the first one, Algorithm 2 calculates the forward displacement, called , at Line 43. Afterwards, the aircraft enter into the latitudinal formation at Line 44.
The aircraft model presented in Subsection 2.3 was used to test the references created by Algorithm 1.
2.3 The Aircraft Model
The simple and well-tested aircraft state space model, see (Anderson and Robbins, 1998) for details, is employed and is given by
Algorithm 1 The transition algorithm
1: procedure FOTLA(i, , vel, r, , , P) 2: 3: 4: side direction(i, N) 5: 6: while do 7: if then 8: 9: 10: 11: 12: else 13: 14: 15: end if 16: if then 17: if side = LEFT then 18: 19: else 20: 21: end if 22: else if then 23: if even(N) then 24: 25: 26: else 27: if then 28: 29: else 30: 31: end if 32: end if 33: 34: 35: else if then 36: if side = LEFT then 37: 38: 39: else 40: 41: end if 42: else 43: 44: 45: end if 46: Ref Ref a 47: does not modify Ref 48: 49: end while 50: return Ref 51: end procedure
Algorithm 2 The advancing algorithm
1: procedure ADVANCING(i, ) 2: if odd(N) then 3: if odd(i) then 4: 5: else 6: 7: end if 8: else 9: if odd(i) then 10: 11: else 12: 13: end if 14: end if 15: return 16: end procedure
where the state variables are: the position variables , flight path heading , flight path angle , and airspeed .
Here, the references created by Algorithm 1 are submitted to a control scheme that employs the above aircraft model. It is presented in (Giacomin and Hemerly, 2013b).
3 Simulation Results
Algorithm 1 is programmed in parallel by using the GNU Message Passing Interface (MPI) Compiler and the C++ programming language. The software Gnuplot is used for plotting the graphics.
The initial condition for all aircraft is: meters, assuming the longitudinal formation, airspeed: 30.5 m/s, and height: 3,050.00 meters. A radius of 4,575.00 meters is used by Algorithm 1 to create the references, and different airspeeds are calculated for each aircraft that allow all aircraft to assume the latitudinal formation at the same time instant. The results are shown in Figures 4, 5, 6 and 7. The Runge-Kutta-4 algorithm is used in the simulation.
The marks shown in Figures 4 and 5 are used to analyze the aircraft crossing. When the aircraft

Figure 4: The aircraft references are marked for crossing analysis.

Figure 5: The aircraft trajectories succeed in following the references.
numbered zero and three are flying over the third mark, the aircraft numbered one and two are ahead. A simple verification algorithm did show that the minimum distance between aircraft 0 and 1 and between aircraft 2 and 3 was 18.3 km and 16.8 km, respectively. Therefore, there is no collision.
The simulation is done by considering a noise of 0.5% for airspeed, and a noise of 0.25% for heading and gamma angles. From Figures 4, 5, 6 and 7, it is possible to conclude that Algorithm 1 creates the references correctly and that the aircraft succeed in following the references.

Figure 6: All aircraft velocities are stable.
It remains to prove the correctness of Algorithm 1 and to analyze its time complexity. This is done

Figure 7: First aircraft heading angle switches between two values.
in Section 4.
4 Theoretical Analysis
Firstly, the time complexity analysis of Algorithm 1 is presented, followed by its proof of correctness.
4.1 The Time Complexity Analysis
The to-turn and go-forward functions are executed over a fixed number of maneuvers, and all other functions used in Algorithm 1 have constant-time complexity. Let be the set of maneuvers, and let be the set of references, with , and the function ref be implemented by using the functions C or FW in the Algorithm 1. Then, is the number of references for each maneuver , and R is a set of sets. The time complexity of Algorithm 1 is
where m represents the total number of time steps for each aircraft trajectory. Since this is also the lower bound for the problem, one concludes that the FLOTLA algorithm has optimal time complexity (Cormen et al., 2009).
4.2 The Proof of Correction
The proof of correction takes into account that Figure 3 describes basically the maneuvers that are executed by Algorithm 1, except the last one, which is created by Algorithm 2.
Theorem 1 Let assume a set of aircraft initially flying in longitudinal formation, with each aircraft equally spaced by from its neighbors. Then, if the FLOTLA algorithm is executed by each aircraft, the latitudinal formation is achieved, with spacing between its neighbors.
Proof: It is considered n aircraft in the squadron. Clearly, if n is even, it can be concluded by analyzing Line 24 of Algorithm 1 that . Then
If is odd, it follows, by analyzing Lines 27 to 31 of Algorithm 1, that . Then
and therefore, for every n and for every i.
Similar reasoning can be applied to . Clearly, if is even and is even, it can be concluded by analyzing Algorithm 2 that . Then
that is the same case that happens when is odd and is even. If is even and is odd, it follows by analyzing Algorithm 2 that , and then
that is the same case that happens when n is odd and i is odd. Therefore, for every n and for every i. Since the same reasoning can be done with different cooperative system bases, and since all aircraft assume the longitudinal formation at the same time instant, the theorem is proved. □
5 Conclusion
An algorithm for changing from longitudinal to latitudinal formation for autonomous aircraft squadrons is presented in this paper. Despite the relevance of this problem, an extensive literature review did not produce relevant results.
The proposed FLOTLA algorithm’s time complexity is optimal, since it is equal to the problem lower bound (Cormen et al., 2009). This result was not different from the opposite case considered in (Giacomin and Hemerly, 2013a).
It was proved that if each aircraft is equally spaced from its neighbors by distance on the longitudinal formation, then the proposed algorithm makes the squadron change its formation to a latitudinal one, keeping the same distance from each aircraft and its neighbors.
The references were created correctly by the proposed algorithm, such that they could be followed by a control scheme, and the theoretical analysis was confirmed by the simulations, by showing that the aircraft do not collide during the formation transition. Additionally, the number of aircraft has to be limited because the aircraft use different velocities, which have to be verified at design time, for security reasons.
References
Alves Neto, A., Macharet, D. G. and Campos, M. F. M. (2010). On the generation of trajectories for multiple uavs in environments with obstacles, J. Intell. Robotics Syst. 57(1-4): 123–141.
Anderson, M. R. and Robbins, A. C. (1998). Formation flight as a cooperative game, Collection of Technical AIAA Guidance, Navigation, and Control Conference and Exhibit 10(12): 244–251.
Chao, Z., Zhou, S.-L., Ming, L. and Zhang, W.-G. (2012). Uav formation flight based on nonlinear model predictive control, Mathematical Problems in Engineering 2012(261367): 1–15.
Cheng, C.-T., Fallahi, K., Leung, H. and Tse, C. K. (2012). A genetic algorithm-inspired uuv path planner based on dynamic programming, IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and Reviews) 42(6): 1128–1134.
Coker, J. D. and Tewfik, A. H. (2011). Performance synthesis of uav trajectories in multi-static sar, IEEE Transactions on Aerospace and Electronic Systems 47(2): 848–863.
Cormen, T. H., Leiserson, C. E., Rivest, R. L. and Stein, C. (2009). Introduction to Algorithms, MIT Press.
Giacomin, P. A. S. and Hemerly, E. M. (2013a). An optimal algorithm for changing from latitudinal to longitudinal formation of autonomous aircrafts squadrons, XI Simpósio Brasileiro de Automação Inteligente.
Giacomin, P. A. S. and Hemerly, E. M. (2013b). Parallel simulation for autonomous aircrafts squadrons using virtual structure and a 3d maneuvers scheme, 22nd International Congress of Mechanical Engineering.
Gu, Y., Campa, G., Seanor, B., Gururajan, S. and Napolitano, M. R. (2009). Aherial Vehicles, InTech, chapter Autonomous formation flight - desing and experiments, pp. 235–257.
Jansen, F. and Ramirez-Serrano, A. (2011). Agile unmanned vehicle navigation in highly confined environments, IEEE International Conference on Systems, Man, and Cybernetics, p. 2381–2386.
Knoll, A. and Beck, J. (2006). Autonomous decision-making applied onto uav formation flight, AIAA Guidance, Navigation, and Control Conference and Exhibit.
Morbidi, F., Freeman, R. A. and Lynch, K. M. (2011). Estimation and control of uav swarms for distributed monitoring tasks, American Control Conference (ACC), 2011, pp. 1069–1075.
Roussos, G. and Kyriakopoulos, K. J. (2012). Decentralized navigation and conflict avoidance for aircraft in 3-d space, IEEE Transactions on Control Systems Technology 20(6): 1622 – 1629.
Santos, S. R. B. d., Givigi, S. N. and Nascimento Junior, C. L. (2012). An experimental validation of reinforcement learning applied to the position control of uavs, Systems, Man, and Cybernetics (SMC), 2012 IEEE International Conference on, pp. 2796–2802.
Venkataramanan, S. and Dogan, A. (2004). A multi-uav simulation for formation reconfiguration, AIAA Modeling and Simulation Technologies Conference and Exhibit. DOI: 10.2514/6.2004-4800.
Xu, N., Kang, W., Cai, G. and Chen, B. M. (2012). Minimum-time trajectory planning for helicopter uavs using computational dynamic optimization, IEEE International Conference on Systems, Man and Cybernetics, pp. 2732–2737.
You, D. I. and Shim, D. H. (2011). Autonomous formation flight test of multi-micro aerial vehicles, J Intell Robot Syst 61(1-4): 321–337. DOI: 10.1007/s10846-010-9481-0.