title: Vector3.SqrMagnitude seems inaccurate
body: <p>I have a function to return the total length of a NavMesh path, using <a href="https://docs.unity3d.com/ScriptReference/Vector3-sqrMagnitude.html" rel="nofollow noreferrer">Vector3.SqrMagnitude</a> to avoid the overhead of the Sqrt calculation in <a href="https://docs.unity3d.com/ScriptReference/Vector3.Distance.html" rel="nofollow noreferrer">Vector3.Distance</a>:</p>
  
  <pre><code>float DistanceAlongPath(NavMeshPath path)
  {
      float sum = 0;
  
      for (int x = 0; x &lt; path.corners.Length - 1; x++)
      {
          sum += Vector3.SqrMagnitude(path.corners[x + 1] - path.corners[x]);
      }
  
      return sum;
  }
  </code></pre>
  
  <p>When the path only has two points the calculation seems fine, however at 3 points or more it always returns a smaller value for a long line than it does for a short line of only 2 points.</p>
  
  <p>The distance shown in the first image is 3848, in the second it's 3419 despite being a much longer path.</p>
  
  <p><a href="https://i.stack.imgur.com/2GH1A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2GH1A.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/gwh58.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gwh58.png" alt="enter image description here"></a></p>
  
  <p>Vector3.Distance works correctly with any number of points. </p>
  
  <p>Am I missing something?</p>