R/pdist.R

Defines functions pdist

Documented in pdist

pdist <-
function(lat, lon, lat1, lon1)
{
	rad <- 6367
	#radius of earth in km
	return(rad * acos(sin(lat) * sin(lat1) + cos(lat) * cos(lat1) * cos(
		lon - lon1)))
}

Try the geo package in your browser

Any scripts or data that you put into this service are public.

geo documentation built on May 2, 2019, 5:22 p.m.