Skip to contents

Calculates the bearing between two point geometries.

Usage

bearing_geodesic(x, y)

bearing_haversine(x, y)

Arguments

x

an object of class rs_POINT

y

an object of class rs_POINT

Value

A vector of doubles of the calculated bearing for between x and y

Examples

x <- geom_point(runif(10, 0, 90), rnorm(10, 1, 90))
y <- geom_point(runif(10, 0, 90), rnorm(10, 1, 90))
bearing_geodesic(x, y)
#>  [1]       NaN 135.80725       NaN       NaN       NaN       NaN       NaN
#>  [8] -21.55129 169.04503       NaN
bearing_haversine(x, y)
#>  [1]    7.392928  135.989047 -166.914024  163.038482  -23.118246 -164.293259
#>  [7]   18.541634  -21.453923  169.091074 -166.403590