title: Efficient way of finding distance between two 3D points
body: <p>I am writing a code in C++ and want to compute distance between two points. 
  <strong>Question 1:</strong> </p>
  
  <p>I have two points P(x1, y1, z1) and Q(x2, y2, z2)  , where x, y and z are floats/doubles. </p>
  
  <p>I want to find the distance between these two points. One way to do it is :</p>
  
  <p>square_root(x_diff<em>x_diff + y_diff</em>y_diff + z_diff*z_diff) </p>
  
  <p>But this is probably not the most efficient way . (e.g. a better formula or a ready made utility in <code>math.h</code> etc ) </p>
  
  <p><strong>Question 2:</strong> </p>
  
  <p>Is there a better way if I just want to determine if P and Q are in fact the same points? </p>
  
  <p>My inputs are x, y and z coordinates of both the points. </p>
  
  <p>Thank you</p>