Does it take into account altitude changes?
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?
double distanceInMetersFloat = initialPosition.distanceTo(finalPosition);
In my app, both initialPosition and finalPosition are Location with altitudes (I set them with Google Elevation API).
According to Google:
Distance is defined using the WGS84 ellipsoid.
But you can do it with or without altitudes.
The altitude is not taken into account when computing
Location.distanceTo
.You can test it like this:
This is the output: