For two particles to collide, the direction of the relative velocity of one with respect to other should be directed towards the relative position of the other particle i.e. ∣r1−r2∣r1−r2→ direction of relative position of 1 w.r.t. 2. & ∣v2−v1∣v2−v1→ direction of velocity of 2 w.r.t. 1 So for collision of A & B ∣r1−r2∣r1−r2=∣v2−v1∣v2−v1