Platinum Partner

Calculate Distance Between 2 Sets Of Longitude/latitude Coordinates.

Takes two sets of coordinates in decimal longitude and latitude format and returns the distance in kilometers.


$lat1 = 46.2341938036161; 
$lon1 = -63.124778021257015; 

$lat2 = 46.4141938036161; 
$lon2 = -63.118571124705284; 

$distance = (3958*3.1415926*sqrt(($lat2-$lat1)*($lat2-$lat1) + cos($lat2/57.29578)*cos($lat1/57.29578)*($lon2-$lon1)*($lon2-$lon1))/180);

print($distance);
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}