Cospectral constructions and spectral properties of variations of the distance matrix