Unmanned aerial vehicles (UAVs) have numerous applications in various scenarios and disciplines including wireless communications and Internet of Things (IoT). This paper studies the trajectory design and collision avoidance in both single-UAV and multiple-UAV settings. During a mission, UAVs communicate with the ground base stations (GBS). In this work, it is assumed that UAVs are equipped with antennas with different radiation patterns. These antenna patterns impact the trajectory design of the UAVs. To achieve efficient performance in UAV trajectory planning, we implement an enhanced-artificial potential field (enhanced-APF) algorithm. The implemented algorithm leads to UAV trajectory designs with collision avoidance, and enables us to identify the overall impact of the 3D antenna patterns on the UAV trajectory. The experimental results demonstrate the effectiveness and the performance of the algorithm, resulting in a smoother trajectory path for UAVs.