Description Usage Arguments Value Examples
Finds the half-way point along the great circle path between two points
1 | dtMidpoint(latFrom, lonFrom, latTo, lonTo)
|
latFrom |
latitude from |
lonFrom |
longitude from |
latTo |
latitude to |
lonTo |
longitude to |
list of the latitude & longitude coordinates at the midpoint along the line
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | dtMidpoint(0,0,0,52)
dtMidpoint(25, 0, -25, 0)
dtMidpoint(-37,144,-38,145)
dtMidpoint(25, 0, 35, 0)
n <- 10
set.seed(20170511)
lats <- -90:90
lons <- -180:180
dt <- data.table::data.table(lat1 = sample(lats, size = n, replace = T),
lon1 = sample(lons, size = n, replace = T),
lat2 = sample(lats, size = n, replace = T),
lon2 = sample(lons, size = n, replace = T))
dt[, c("latMid", "lonMid") := dtMidpoint(lat1, lon1, lat2, lon2)]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.