One of the main challenges posed by the next space systems generation is the high level of autonomy they will require. Hazard Detection and Avoidance is a key technology in this context. An adaptive guidance algorithm for landing that updates the trajectory to the surface by means of an optimal control problem solving is here presented. A semi-analytical approach is proposed. The trajectory is expressed in a polynomial form of minimum order to satisfy a set of boundary constraints derived from initial and final states and attitude requirements. By imposing boundary conditions, a fully determined guidance profile is obtained, function of a restricted set of parameters. The guidance computation is reduced to the determination of these paramet...