a=x1

b=vx1

c=x2

d=vx2

e= sum of radii

t= time

e = (a+bt)-(c+dt)

e² = (a+bt)-(c+dt)* (a+bt)-(c+dt)

Multiply out

-2abt + 2ac + 2adt -a2 + 2bct + 2bdt2 -b2t2 -2cdt -c2 -d2t2 + e = 0

Rearrange

2bdt^2 - b2t^2 - d2t^2

-2abt + 2adt + 2bct – 2cdt

-a2 - c2 + 2ac+ e

= 0

Factorise

(2ab- b² - d²)t²

-2t(ab + ad + bc - cd)

-a² - c² + 2ac + e

This looks like a quadratic since if we remove all known variables we get

t² - 2t +c

Therefore we can solve using the x = (-b +- root(b² -4ac))/2a

Let x=t

Let a=A (a, b, d) = (2ab- b² - d²)

Let b=B (a, b, c, d) = (2(ab + ad + bc – cd))

Let c=C (a, c, e) = -a² - c² + 2ac + e

solve this for each plane we need to consider and find the closest positive time to zero.