SparkFun Forums 

Where electronics enthusiasts find answers.

Tips and questions relating to the GPS modules from SFE
By RonnyM
#13530
I would like to know how to convert a relative position to feet from the last waypoint. I know that the relation between distance and lattitude and longitude numbers change depending on the distance from the equator, but a rough idea would be very helpful. I'd like to use the numbers for range testing.

Thanks,
Ron
By wiml
#13534
For a very rough value, you can just convert each angle to a distance and then use pythagoras' theorem to find the distance along the diagonal. To convert a difference in latitude to a distance, take the value in radians and multiply by the radius of the Earth. To convert a difference in longitude, take the value in radians, multiply by the cosine of the latitude where you are and then by the radius of the Earth.

For a more accurate value, especially over long distances, you'll want to compute a great-circle distance and you'll want to take into account the earth's oblateness (it's not quite a perfect sphere). Take a look at this GIS FAQ and this GIS FAQ.