I would like to be able to calculate/show the speed I'm traveling on a car by using the GPS info in order to calculate it.

So far I've read the coordinates and the timestamp at fixed intervals then using the 'haversine' formula I can calculate the distance which divided by the timestamps' difference should give me the speed, right? Wrong...

Or may be partially right/wrong. The problem is that the result I get is extremely unstable. I'm driving at let say 30 km/hour the App shows the same result as the car's speedometer and suddenly it goes to 78 and back to 30.

By what I've read in the last several hours it is probably due to the GPS accuracy which takes me to the point of this post,

**has anybody a working script (willing to share) that would provide a reliable speed reading using the GPS coordinates (both on iPhone and Android)**? Or at least a suggestion as how to implement it.

Many thanks