dplyr::rowwise is required to apply this function in dplyr::mutate.

mis_bearing(from, to, water)

Arguments

from

The smallest bearing of the sector, measured clockwise from North

to

The largest bearing of the sector, measured clockwise from North

water

The bearing of a direction

Examples

testthat::expect_equal(mis_bearing(10, 50, 40), c(30, 40))
testthat::expect_equal(mis_bearing(10, 50, 340), c(340, 30))
testthat::expect_equal(mis_bearing(30, 50, 230), c(230, 40))
testthat::expect_equal(mis_bearing(30, 50, 210), c(40, 210))