Calculate Shortest Distance Between Two Lines

Line passing through the point A(a1,b1,c1) parallel to the vector V1(p1,q1,r1)
Point A(,,)
Vector V1(,,)
Line passing through the point B(a2,b2,c2) parallel to the vector V2(p2,q2,r2)
Point B(,,)
Vector V2(,,)

Shortest distance between two lines(d)