title: 3d collision formula based on xyz
body: <p>Here is the problem. We have two points (spheres) in xyz, with this info:</p>
  <p>1- x,y,z =&gt; The center of the object is currently located at</p>
  <p>2- r =&gt; The collision radius of the object</p>
  <p>3- Vx, Vy, Vz =&gt;  object is traveling along the vector. If that vector is (0,0,0), the object is stationary.</p>
  <p>Note: The radii and positions are in meters and velocities are measured in meters per second.</p>
  <p><strong>Question</strong>: For each test, output a single line containing the time (in seconds) since the start of the test at which the two objects will first collide. If they never collide, print No collision instead.</p>
  <p>I want to know about the formula of calculation this time. Any idea would be appreciated.</p>
  <p>Examples:</p>
  <pre><code>1-
  
  xyz(1): -7 5 0
  v(1): -1 0 3
  r(1): 3
  
  xyz(2): 10 7 -6
  v(2): -2 0 4
  r(2): 6
  
  
  t: 8.628 // this is the answer
  </code></pre>
  <pre><code>2-
  
  xyz(1): 10 3 -10
  v(1): -9 3 -8
  r(1): 5
  
  xyz(2): 2 0 0
  v(2): 6
  r(2): -4 3 -10
  
  
  t: 0.492 // this is the answer
  </code></pre>