title: What is the best way to get distance between 2 points with DirectXMath
body: <p>Using the new XMVECTOR and XMFLOAT3 classes what is the best way to get the distance between 2 points? I couldn't find a function that does it in XMVector* family of functions so I came up with the following : </p>
  
  <pre><code>float distance(const XMFLOAT3&amp; v1,const XMFLOAT3&amp; v2)
  {
      XMVECTOR vector1 = XMLoadFloat3(&amp;v1);
      XMVECTOR vector2 = XMLoadFloat3(&amp;v2);
      XMVECTOR vectorSub = XMVectorSubtract(vector1,vector2);
      XMVECTOR length = XMVector3Length(vectorSub);
  
      float distance = 0.0f;
      XMStoreFloat(&amp;distance,length);
      return distance;
  }
  </code></pre>
  
  <p>Will this be faster than a normal Vector3 class with just 3 floats for x,y,z and then using sqrt because it uses intrinsic optimizations? Namely : </p>
  
  <pre><code>float Distance(const Vector3&amp; point1,const Vector3&amp; point2)
  {
      float distance = sqrt( (point1.x - point2.x) * (point1.x - point2.x) +
                              (point1.y - point2.y) * (point1.y - point2.y) +
                              (point1.z - point2.z) * (point1.z - point2.z) );
      return distance;
  }
  </code></pre>