Optimal Spacecraft Trajectories