I was finding the closest approach of an asteroid (whose energy is sufficient to exit the gravitational field of the star )so that it can escape the gravitational field of the planet .The asteroid has a velocity and is being attracted by the planet and is leaving the star. Why should it deflect away from the star like this if gravitational force is attractive?
Well I think if I mention the whole question it'll useful so the question is 

> 
> An asteroid is approaching a star of radius r . The impact parameter is b . Find the minimum value of b for which asteroid will just escape on falling into the star.
> 
> 
> 

My instructor said the drawing should be 

[![enter image description here](https://i.stack.imgur.com/XyaJgs.jpg)](https://i.stack.imgur.com/XyaJgs.jpg)

Why it shouldn't deflect like this?
Instructor said if this happens then it will be orbiting the planet. 

[![enter image description here](https://i.stack.imgur.com/Lfb5ns.jpg)](https://i.stack.imgur.com/Lfb5ns.jpg)