title: Finding the distance between 2 3D points
body: <p>I'm running into a problem where my square of X is always becoming infinite leading to the resulting distance also being infinite, however I can't see anything wrong with my own maths:</p>
  
  <pre><code>// Claculate distance
  
  xSqr = (x1 - x2) * (x1 - x2);
  ySqr = (y1 - y2) * (y1 - y2);
  zSqr = (z1 - z2) * (z1 - z2);
  
  double mySqr = xSqr + ySqr + zSqr;
  
  double myDistance = sqrt(mySqr);
  </code></pre>
  
  <p>When I run my program I get user input for each of the co-ordinates and then display the distance after I have run the calulation.</p>