distFromPos function

Distance matrix from position matrix