I have two parametric line equations for a 3D space, $A(t)$ and $B(t)$. Both of these lines have a "velocity" vector as a direction vector. Both equations actually represent a point moving through space at a specific speed, and the line represents its path through space. Each line equation has a different "speed".

So, I have these two line equations that actually represent moving points (think two mosquitos travelling in straight lines at different speeds).

I need to find a line equation that will "hit" both $A(t)$ and $B(t)$ (think bug spray, trying to hit the mosquitoes). This line also has a "velocity" (and thus "speed"). However, once the line intersects ("hits" is the term I used above) one of the other lines ($A(t)$ or $B(t)$), it will take some amount of time for it to intersect the other (as it is travelling at a constant speed, and not instantaneously). However, I need this line equation to travel the least possible distance between intersecting one line and then the other.

My problem arises in finding this line equation, specifically the direction vector. I need the third line to almost "predict" the future location of the lines - it hits one (say, $A(t)$) and then, because both $B(t)$ and the (not yet found) line would be travelling at different speeds, the (not yet found) line would need to be perfectly position to intersect $B(t)$.

So far, I've deduced that the third line will intersect $B(t)$ at $t = t\_c - a$ and $A(t)$ at $t = t\_c + b$ ($B(t)$ travels faster than $A(t)$, and thus the third line must intersect it first). $t\_c$ is the $t$ value when $A(t)$ and $B(t)$ are closest together. $a$ and $b$ are some real values that represent seconds (the same unit as $t$).

I don't know where to go from here, or if I'm even on the right track. How could you find a line that intersects two other lines, with different velocities, while also minimising the distance the third line travels between intersecting the other lines?

I was hoping for some insight into the problem (specific values weren't provided for this reason - I don't need the full working, I just need some guidance to the solution). This is a fairly unique problem, as the lines I am dealing with actually represent a point moving through a 3D space.

Thanks for any help.