What determines the direction of an object that has undergone the effect of a gravitational slingshot? I just started researching this topic and therefore I do not know much about it. Nonetheless, I am still curious about what determines the direction an object takes after passing by a planet. I think the new direction is most likely determined by the gravity of set planet and the new direction can be calculated using vectors. But I also think that the speed of the planet can have an influence in the new direction of the object. In both cases I believe that the new direction is found by adding vectors or by using Pythagora's. Can someone correct me?
 
 A: Under some mild assumptions this is a simple calculation. Consider a system of the Sun, a satellite and Jupiter. In a coordinate system where the Sun is stationary Jupiter and the satellite have velocities $\vec{v}_J$, $\vec{v}_s$ respectively. We will have to make the assumption that we don't care about the Sun's influence on the Satellite during the slingshot maneuver itself - that way we are left with a series of 2-body problems to solve: Jupiter orbits the Sun, the Satellite initially is in a solar orbit, at some point we turn off the Sun and turn on Jupiter and consider the satellite in a hyperbolic orbit around Jupiter, and when the satellite is far away again we return to considering it to be in the Sun's gravitational field only.
For this question we really only need to know two things: the velocity $\vec{v}_J$ of Jupiter with respect to the Sun during the flyby, and the change in the satellite's velocity $\Delta\vec{v}_s$ as a result of the flyby. We'll take the former as a given and worry only about the latter. It's easiest to move to the instantaneous rest frame of Jupiter, and we'll hope that the interaction happens fast enough that Jupiter doesn't move too much. With those assumptions the satellite is going to move on a hyperbola around the fixed mass of Jupiter. The deflection will change the direction but not the magnitude of the satellites velocity. Let's denote this change by the rotation matrix $\hat{R}$. Since in Jupiter's rest frame $\vec{v}_s^{IRF}=\vec{v}_s-\vec{v}_J$ we have:
$$\Delta \vec{v} = (\hat{R}-\hat{1})(\vec{v}_s-\vec{v}_J)$$
Which gives a final velocity in the Sun's frame as:
$$\vec{v}_s^{\text{final}}=\vec{v}_s+\Delta\vec{v}=\hat{R}\vec{v}_s+(\hat{1}-\hat{R})\vec{v}_J$$ 
So the steps to finding the final velocity are:
1) Find the deflection angle $D$ of the satellite around a stationary point mass. This is a well known problem (it's equivalent to Rutherford scattering for one thing).
2) Find a rotation matrix $\hat{R}$ that rotates by the angle $D$
3) Compute the sum given above. It clearly consists of a rotated version of the initial velocity plus Jupiter's velocity and then minus a rotated version of Jupiter's velocity. So while it is just "vector addition" like OP suspects, it's not the first combination you would guess.

Remark: the approximations made here amount to using a patched conic approximation that at every point we consider only the two most relevant bodies and solve the 2-body problem. I think this is probably accurate for this case for the above reasons.
