4

I would like to calculate distance between 2 points of latitude and longitude i have read about Haversine Formula and Spherical Law of Cosines for calculate distance between two points but my main motive is get best location difference between 2 points in Meters.

For Example Two devices place at next to each other and that android devices is sending location to server,So we need to take that location of each device and calculate minimum distance between these 2 device in meter.Difference of location should be like 2-3 meters when device is placed next to each others

So what are the possible ways to calculate minimum distance between two device in meters when device next to each other

Edit 1: I need to calculate distance which i got in kms or miles which is big difference when device is next to each other. Haversine Formula and Spherical Law of Cosines is i found best way to calculate but i need to do more in these formulas to get minimum difference between 2 device.Not on Android Device. This question is not related to This Question

Community
  • 1
  • 1
androidXP
  • 1,692
  • 3
  • 27
  • 58
  • @VladMatvienko I need to work on Above formula to calculate and outcome require in meters which can be in few meters only.Read both question its different – androidXP Sep 19 '16 at 07:57
  • If you are NOT calculating the distance between two points of latitude and longitude in Android, you should NOT tag your question 'android' or 'google-maps' since they are unrelated. – Pang Sep 19 '16 at 09:07
  • And what do you mean by *"minimum distance between two device"*? The distance between two points is just a single value so what do you mean by minimum? Please explain in your question. – Pang Sep 19 '16 at 09:09
  • private float Distance(double lat1, double lon1, double lat2, double lon2) { float[] distance = new float[2]; Location.distanceBetween(lat1, lon1, lat2, lon2, distance); return distance[0]; } – Harish Reddy Apr 18 '18 at 05:21

0 Answers0