bearing: Bearing calculations

View source: R/bearing.R

bearingR Documentation

Bearing calculations

Description

Bearing calculations

Usage

bearing(lat_orig, lon_orig, lat_dest, lon_dest)

compass2bearing(compass)

easterly_component(compass)

northerly_component(compass)

Arguments

lat_orig, lon_orig, lat_dest, lon_dest

Latitude and longitude of origin and destination.

compass

A character vector of compass rose points, such as c("NW", "E", "SSW").

Value

bearing

An approximate bearing from _orig and _dest.

compass2bearing

The bearing encoded by the compass input.

easterly_component

The easterly component of a unit vector pointing in the direction provided.

Examples

bearing(0, 0, 90, 0)
bearing(-35, 151, 51, 0)

compass2bearing("NW")
easterly_component("E")
easterly_component("NW")



hutils documentation built on April 13, 2022, 5:23 p.m.