The geometry of multidimensional scaling