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       NaN       NaN       NaN 102.25257       NaN  45.36525
#>  [8]       NaN 136.07896 131.84963
bearing_haversine(x, y)
#>  [1] -155.781634   32.102556    4.788133 -167.073580  102.359239 -172.867598
#>  [7]   45.177361  170.224708  136.263450  132.033663