title: Calculating the distance between each pair of a set of points
body: <p>So I'm working on simulating a large number of n-dimensional particles, and I need to know the distance between every pair of points. Allowing for some error, and given the distance isn't relevant at all if exceeds some threshold, are there any good ways to accomplish this? I'm pretty sure if I want <code>dist(A,C)</code> and already know <code>dist(A,B)</code> and <code>dist(B,C)</code> I can bound it by <code>[dist(A,B)-dist(B,C) , dist(A,B)+dist(B,C)]</code>, and then store the results in a sorted array, but I'd like to not reinvent the wheel if there's something better.</p>
  
  <p>I don't think the number of dimensions should greatly affect the logic, but maybe for some solutions it will. Thanks in advance.</p>