R/difflon.R

Defines functions `difflon`

`difflon` <-
function(LON1, LON2)
{

deg2rad = 0.01745329252
c1 = cos(LON1*deg2rad)
s1 = sin(LON1*deg2rad)
c2 = cos(LON2*deg2rad)
s2 = sin(LON2*deg2rad)

radd = acos(c1*c2+s1*s2)

sn = sign(c1*s2-s1*c2)

return(list(deg=radd/deg2rad, sn=sn))

}

Try the GEOmap package in your browser

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

GEOmap documentation built on Sept. 1, 2023, 5:09 p.m.