haversine_intermediate {rsgeo}R Documentation

Identifies a point between two points

Description

Identifies the location between two points on a great circle along a specified fraction of the distance.

Usage

haversine_intermediate(x, y, distance)

Arguments

x

an rs_POINT vector

y

an rs_POINT vector

distance

a numeric vector of either length 1 or the same length as x and y

Value

an object of class rs_POINT

Examples

x <- geom_point(1:10, rep(5, 10))
y <- geom_point(1:10, rep(0, 10))
res <- haversine_intermediate(x, y, 0.5)
if (rlang::is_installed(c("wk", "sf"))) {
  plot(
    c(x, y, res),
    col = sort(rep.int(c("red", "blue", "purple"), 10)),
    pch = 16
  )
}

[Package rsgeo version 0.1.6 Index]