Explaining the provided link:
The linear segments
A(u) = A0 + u * Va
and
B(u) = B0 + u * Vb
are just parametric representations of the segments Va = (A0, A1)
and Vb = (B0, B1)
. You should recall that the vector can be represented by the difference of the end points. That's why Va = A1 - A0
and Vb = B1 - B0
.
A(u)
and B(u)
are said to be parametric because as you vary the parameter u
from 0
to 1
you get points A(u)
or B(u)
that will build the segment Va
or Vb
(respectively) from the starting point A0
or B0
(respectively) to the the end point A1
or B1
(respectively). You can see that by thinking of the cases where u = 0, where A(u) = A0 and B(u) = B0
(starting points) and where u = 1, where A(u) = A1 and B(u) = B1
(end points). Any value of u
between 0
and 1
will result in points between A0
and A1
or B0
and B1
(respectively).
The expression
( B(u) - A(u) )* ( B(u) - A(u) )
is just the dot product of the vector that represents the distance of the points B(u)
and A(u)
with itself. The formula of the squared distance between two points is
d^2[ A(u), B(u) ] = ( xA(u) - xB(u) )^2 + ( yA(u) - yB(u) )^2
Derivation come from the Pythagorian theorem and can be seen here. By the definition of the dot product, we see that
( B(u) - A(u) ) * ( B(u) - A(u) ) = d^2[ A(u), B(u) ]
, since the dot product sums the product of the components of the vector.
The last statement of the article is that when the collision occurs
[ B(u) - A(u) ] * [ B(u) - A(u) ] = ( ra + rb ) ^ 2
where ra and rb are the radii of the spheres. What this expression means is that the first time of collision occurs when the distance between A(u)
and B(u)
is equals to the distance between the centers of the spheres. This is true because ra + rb
represents the distance of the centers when the spheres are side-by-side. It is squared just because the other side of the equation also is, so they are in the same measuring unit.