There actually is a delightful formula -- see page 11 at http://www.artofproblemsolving.com/Resources/Papers/Bary_full.pdf http://www.mit.edu/~evanchen/handouts/bary/bary-full.pdf
Your displacement vector is (u-1,v,w)$(u-1,v,w)$, giving d^2=-(a^2vw+b^2w(u-1)+c^2v(u-1))$d^2=-(a^2vw+b^2w(u-1)+c^2v(u-1))$