A formation control and obstacle avoidance algorithm has been introduced in this paper for the V-shape formation flight of fixed-wing UAVs (Unmanned Aerial Vehicles) using the potential functions method. An innovative vector approach has been suggested to fix the conventional challenge in employing the artificial potential field (APF) approach (the creation of local minimums). A method called variable repulsive circles (VRC) has been then presented aimed at designing proper flight paths tailored with functional limitations of fixed-wing UAVs in facing obstacles. Finally, the efficiency of the designed algorithm has been examined and evaluated for different flight scenarios.