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