Trajectory optimization and guidance for a hypersonic vehicle