# create 10 points at the origin
pnts <- geom_point(rep(0, 10), rep(0, 10))
# set seed for reproducibiliy
set.seed(1)
# generate random bearings
bearings <- runif(10, 0, 360)
# generate random distances
distances <- runif(10, 10000, 100000)
# find the destinations
dests <- haversine_destination(pnts, bearings, distances)
# plot points
if (rlang::is_installed(c("sf", "wk"))) {
plot(pnts, pch = 3)
plot(dests, add = TRUE, pch = 17)
}
Run the code above in your browser using DataLab