Create map of squares of the distances for each data point, that will be calculated once.