Given 2 skew lines

ru = (x1, y1, z1) + u(a1, b1, c1)

rv = (x2, y2, z2) + v(a2, b2, c2)

Verify the formula for the shortest distance of the line.

Okay what I did was that I found the distance between 2 points r = (x1-x2, y1-y2, z1-z2) and then generated a vector that is orthogonal to the 2 lines using cross product and projected r onto d (the distance). The problem I'm having is simplying the equation into the final equation. How do I simplify r.(u x v) into that 3x3 matrix?