In[]:=
DistanceMatrix[{{a,b},{c,d}}]
Out[]=
{{0,2},{2,0}}