Sometimes the simplest solution is the best. Why not include the ship position as input to the function that generates asteroids, and simply not generate asteroids when it's within X distance from the ship spawn?