An exact solution to Lambert’s problem