you mean x2-x1, y2-y1, z2-z1?

Distance in 3D works the same as in 2D, you just tack the Z in on the end of Pythagorean to get the distance. Rather than Sqrt( (dX)^2 + (dY)^2) you get Sqrt( (dX)^2 + (dY)^2 (dZ)^2)