dist function

QTS Distance Matrix Computation