The distance between A and B, A = (1,4,7), B = (1,-1,1)

7.8102496759... = √61

The midpoint is (1, 3/2, 4). The line AB is x = 1, y = 4-5t, z = 7-6t (t real number).

Con WolframAlpha:

Another example. The distance between (0,0,0) and (1,1,1):

1.7320508075688... = √3

The midpoint is (1/2,1/2,1/2). The line (0,0,0)-(1,1,1) is x = t, y = t, z = t (t real number).