Calculate great circle distance and bearing between spatial coordinates.

lonlat_to_bearing(origin_lon, origin_lat, dest_lon, dest_lat)

Arguments

origin_lon

the origin longitude

origin_lat

the origin latitude

dest_lon

the destination longitude

dest_lat

the destination latitude

Examples

# one degree longitude should equal approximately 111km at the equator lonlat_to_bearing(0, 0, 1, 0)
#> $bearing #> [1] 90 #> #> $gc_dist #> [1] 111.1949 #>