Jasper Goes
Shanghai Pudong Railway Station

Welcome to JasperGoes.com
The home of Jasper Goes and his projects

As a true loyal Nokia fan I am constantly working on the My World GPS Tracker app, a GPS tracking software that allows you to put your actual locations on the map in real-time, using any gps enabled Nokia device, and others like BlackBerry and Samsung devices.

If you feel like you need to reach me, contact me at jasper ->at<- jaspergoes.nl

My World Cell Phone GPS Tracker
Location Of


You are mostlikely looking for My World cell phone GPS Tracker or the Location Of GPS Tracker - Click here


< Jasper's live location

Useful Articles

Distances using Haversine formula in Javascript

This uses the haversine formula to calculate great-circle distances between the two points.
That is, the shortest distance over the earth's surface giving an as-the-crow-flies distance between the points (ignoring any hills!)


Haversine formula:

R = earth’s radius (mean radius = 6,371km)
Δlat = lat2− lat1
Δlong = long2− long1
a = sin²(Δlat/2) + cos(lat1).cos(lat2).sin²(Δlong/2)
c = 2.atan2(√a, √(1−a))
d = R.c

(Note that angles need to be in radians to pass to trig functions).

JavaScript:
var R = 6371; // km
var dLat = (lat2-lat1).toRad();
var dLon = (lon2-lon1).toRad(); 
var a = Math.sin(dLat/2) * Math.sin(dLat/2) +
        Math.cos(lat1.toRad()) * Math.cos(lat2.toRad()) * 
        Math.sin(dLon/2) * Math.sin(dLon/2); 
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); 
var d = R * c;

The haversine formula remains particularly well-conditioned for numerical computation even at small distances, unlike calculations based on the spherical law of cosines. The versed sine is 1-cosθ, and the half-versed-sine (1-cosθ)/2 = sin²(θ/2) as used above. It was published by R W Sinnott in Sky and Telescope, 1984, though known about for much longer by navigators. (For the curious, c is the angular distance in radians, and a is the square of half the chord length between the points).


Spherical Law of Cosines

In fact, when Sinnott published the haversine formula, computational precision was limited. Nowadays, JavaScript (and most modern computers & languages) use IEEE 754 64-bit floating-point numbers, which provide 15 significant figures of precision. With this precision, the simple spherical law of cosines formula (cos c = cos a cos b + sin a sin b cos C) gives well-conditioned results down to distances as small as around 1 metre. In view of this it is probably worth, in most situations, using either the simpler law of cosines or the more accurate ellipsoidal Vincenty formula in preference to haversine! (bearing in mind notes below on the limitations in accuracy of the spherical model).

Contacting Jasper Goes

Jasper Goes

If you want to reach me, please contact me through either skype or email.

Skypejaspergoes
Emailjasper ->at<- jaspergoes.nl


© Jasper Goes 2006 - 2012