***** To join INSNA, visit http://www.insna.org *****

Katrien:

 

Here’s the formula for calculating the distance between longitude-latitude coordinates based on the spherical law of cosines, including implementation code in JavaScript and Excel:

 

Spherical law of cosines:

d = acos(sin(lat1).sin(lat2)+cos(lat1).cos(lat2).cos(long2−long1)).R

 

JavaScript:

var R = 6371; // radius of the earth, in km
var d = Math.acos(Math.sin(lat1)*Math.sin(lat2) +
                  Math.cos(lat1)*Math.cos(lat2) *
                  Math.cos(lon2-lon1)) * R;

 

Excel:

=ACOS(SIN(lat1)*SIN(lat2)+COS(lat1)*COS(lat2)*COS(lon2-lon1))*6371

 

Scott Social Media Allen

Social media is my middle name

Office: 512.487.7297

Mobile: 512.486.0701

Skype: ScottAllenTVH

 

_____________________________________________________________________ SOCNET is a service of INSNA, the professional association for social network researchers (http://www.insna.org). To unsubscribe, send an email message to [log in to unmask] containing the line UNSUBSCRIBE SOCNET in the body of the message.