Consider the positions of each ball as a function of time. Distance (position) is equal to velocity times time. We want 'cos' in the answer, so we'll work with the x axis. For ball P, the position is equal to 18t, since we are given the horizontal (x axis) velocity. For ball Q, the position is equal to the x component of its velocity, since it is shot at an angle 'a'. To find this we multiply the magnitude by cos'a', to get its x component. Then we can do the same, to work out its position as 30tcos'a'. When they collide, they are in the same x position at the same time, so we equate these two functions. 18t = 30tcos'a'. The t's cancel. Rearrange to get cos'a' = 18/30. This simplifies to cos'a' = 3/5