title: Finding distance between points in 3D space using correct optimization algorithm C++
body: <p>It's easy to use the mathematical formula to find distance between any two points in 3D space which is:<code>√((x2-x1)^2 )+(y2-y1)^2+(z2-z1)^2</code></p>
  
  <p>And it's pretty easy to calculate for finding distance between any two points in space where each point has (x, y z) coordinates in 3D-space.</p>
  
  <p>My question, extends this formula to a large scale where I'm facing optimization hiccups. What I did was create a simple <code>Vector</code> class and use this formula coded in C++ to calculate the distance. </p>
  
  <p>What if there are a 1000 points? How do I go about it? I'm thinking using a simple <code>std::vector</code> to store these 3D points won't be optimized way of calculating the distance between these 1000 points. </p>