An adaptive guidance algorithm for aerospace vehicles