You sholud first find the distance between the two given objects as a function of time. I'm not sure if [itex]\theta[/itex] in your picture is [itex]90^{\circ}[/itex] angle or not, but cosine rule will definitely work.
Then you find the first derivative of that function in order to find the time at which the distance is minimum. When you got that time, it's easy to find the distance by plugging it back to the distance function.