3

Possible Duplicate:
Get the distance between two geo points

distanceTo(Location dest) or distanceBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude, float[] results)

is calculate distance for people walk or driving car?

How calculate distance between two coordinates for car?

Community
  • 1
  • 1

3 Answers3

2

A quick google leads me to a whole lot of formula working on coordinates, which includes what you are working on:

http://www.movable-type.co.uk/scripts/latlong.html

mauris
  • 42,982
  • 15
  • 99
  • 131
0

According to the docs the distance between two points is the straight way between them. If you want the distance between two cars and taking streets etc. into account you need more waypoints:

Computes the approximate distance in meters between two locations, and optionally the initial and final bearings of the shortest path between them. Distance and bearing are defined using the WGS84 ellipsoid.

Harald Wilhelm
  • 6,656
  • 11
  • 67
  • 85
0

you can get distance for 2 address by: http://maps.googleapis.com/maps/api/distancematrix/xml?origins="+a+"&destinations="+b+"&mode=driving&language=en-EN&sensor=false

good luck.

D T
  • 3,522
  • 7
  • 45
  • 89