Optimal midcourse guidance for medium-range air-to-air missiles