// for derivation, see http://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html
// x1 = orig
// x2-x1 = dir, which means |x2-x1| is 1.0
// for derivation, see http://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html
// x1 = orig
// x2-x1 = dir, which means |x2-x1| is 1.0