Calculate distance, bearing and more between two Latitude/Longitude points shows lots of equations in math, and implemented in JavaScript. But it wasn't working, because my GPS points (Lat/Lon) were in decimal degrees, not radians. where Chip gives RadiusEarth as 6378.135 kilometres.