Given
#L_1->p_1 = p_(01) + lambda_1 vec v_1# and
#L_2->p_2 = p_(02) + lambda_2 vec v_2#
with #p_1 = (x_1,y_1)# and #p_2 = (x_2,y_2)# the distance between two generic points #p_1# and #p_2# is given by
#d(lambda_1,lambda_2)=norm(p_1-p_2) = norm(p_(01)-p_(02)+lambda_1 vec v_1-lambda_2 vec v_2)# or
#d^2(lambda_1,lambda_2) = norm(p_(01)-p_(02))^2+lambda_1^2norm(vec v_1)^2+lambda_2^2norm(vec v_2)^2+2lambda_1 << p_(01)-p_(02), vec v_1 >> - 2lambda_2 << p_(01)-p_(02), vec v_2 >>-2lambda_1 lambda_2 << vec v_1, vec v_2 >>#
Now the condition for minimum in #d^2(lambda_1,lambda_2) # which is a continuous #C^2# function, is
#{((partial d^2(lambda_1,lambda_2))/(partial lambda_1) = 2lambda_1 norm(vec v_1)^2+2 << p_(01)-p_(02), vec v_1 >> -2lambda_2 << vec v_1, vec v_2 >> =0),((partial d^2(lambda_1,lambda_2))/(partial lambda_2) = 2lambda_2 norm(vec v_2)^2-2 << p_(01)-p_(02), vec v_2>> -2lambda_1 << vec v_1, vec v_2 >> =0):}#
solving now the system
#{(lambda_1 norm(vec v_1)^2+ << p_(01)-p_(02), vec v_1 >> -lambda_2 << vec v_1, vec v_2 >> =0),(lambda_2 norm(vec v_2)^2- << p_(01)-p_(02), vec v_2>> -lambda_1 << vec v_1, vec v_2 >> =0):}#
or
#((norm(vec v_1)^2, - << vec v_1, vec v_2 >>),(- << vec v_1, vec v_2 >>, norm(vec v_2)^2))((lambda_1),(lambda_2)) = ((- << p_(01)-p_(02), vec v_1 >>),(<< p_(01)-p_(02), vec v_2 >>) ) #
Now with
#p_01 = (0, 2, -2)#
#p_02 = (1, -2, 6)#
#vec v_1 = (1, -1, 1)#
#vec v_2 = (3, -2, 2)#
or
#((3, -7),(-7, 17))((lambda_1),(lambda_2))=((13), (-27))#
giving
#lambda_1 = 16, lambda_2 = 5# so the distance is
#d(16,5) = 2 sqrt 2# and the points at which this condition is verified are
#p_1 = (16, -14, 14)#
#p_2 = (16, -12, 16)#