title: What distance does distanceTo returns?
body: <p>Does it take into account altitude changes?</p>
  
  <p>I mean, if I start in left vertex of this triangle and end in the right upper vertex, does it return distance a or b?</p>
  
  <pre><code>double distanceInMetersFloat = initialPosition.distanceTo(finalPosition);
  </code></pre>
  
  <p>In my app, both initialPosition and finalPosition are Location with altitudes (I set them with Google Elevation API).</p>
  
  <p>According to Google:  </p>
  
  <blockquote>
    <p>Distance is defined using the WGS84 ellipsoid.</p>
  </blockquote>
  
  <p>But you can do it with or without altitudes.</p>
  
  <p><a href="https://i.stack.imgur.com/11Ket.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/11Ket.gif" alt="enter image description here"></a></p>