You know the lengths of the two sides of a triangle and the angle between the two sides so you can use the cosine law, $\displaystyle c^2= a^2+ b^2- 2ab cos(C)$ to get a formula for the third side, the distance between them. Differentiate to get a formula connecting the rates.