What is the distance between #(8, 6, 2) # and #(0, 6, 0) #?
Let the length of the strait line be r
You can consider the points as a combination of triangles. First you work out the projection of the line on to the xy plain (the adjacent) using Pythagoras. You then work out the related triangle for the z plane again using Pythagoras where r is the hypotenuse (the line). You finish up with a 3 dimensional version of the standard form