A Mathematical Framework for Unmanned Aerial Vehicle Obstacle Avoidance