0

I would like to calculate the distance from the values I get from my Cordova-Geolocation Plugin. Is this possible with Javascript? I would like to have the answer in Meters. I'm not able to figure out how this formula works or where to start.

I found many sites which are able to do this, but I'm not able to code this formula on my own. Can someone help me?

www139
  • 4,551
  • 2
  • 28
  • 54
Sithys
  • 3,503
  • 8
  • 30
  • 58
  • 1
    You need some math chops [activated](http://en.wikipedia.org/wiki/Haversine_formula) – Ali Gajani Dec 03 '14 at 13:50
  • Google "havasine formula javascript". Or see this question: http://stackoverflow.com/questions/14560999/using-the-haversine-formula-in-javascript – Turnip Dec 03 '14 at 13:51
  • possible duplicate of [Calculate distance between 2 GPS coordinates](http://stackoverflow.com/questions/365826/calculate-distance-between-2-gps-coordinates) – Atilla Ozgur Dec 03 '14 at 13:53

1 Answers1

1

This site has working demo and javascript functions. I used following search terms to find this site. gps coordinates distance spherical. This question has also an answer.

Community
  • 1
  • 1
Atilla Ozgur
  • 13,943
  • 3
  • 48
  • 66