Designing unmanned aerial vehicle trajectories for energy minimization