R/absolute_angle.R
absolute_angle.RdReturn the smallest possible angle between two compass bearings
absolute_angle(from, to)The start bearing, counted clockwise from North
The end bearing, counted clockwise from North
The smallest possible angle between the two bearings as decimal degrees
within [0..360[.
Other helpers:
add_dates(),
datetime_as_isoweek(),
datetime_as_seasonweek(),
datetime_as_season(),
datetime_as_turtle_date(),
exclude_training_species(),
exclude_training_surveys(),
extract_possibly(),
fdate_as_tdate(),
filter_missing_site(),
filter_missing_survey(),
filter_surveys_missing_end(),
filter_surveys_requiring_qa(),
filter_wastd_season(),
get_more(),
gj_linestring_to_st_linestring(),
httpdate_as_gmt08_turtle_date(),
httpdate_as_gmt08(),
httpdate_as_season(),
humanize(),
join_tsc_sites(),
leaflet_basemap(),
map_chr_hack(),
mean_bearing(),
mis_bearing(),
odkc_works(),
read_table(),
sentencecase(),
sf_as_tbl(),
tdate_as_fdate(),
tracks_as_geojson(),
tun(),
urlize(),
verify_odkc_turtledata(),
verify_wamtram_data(),
verify_wastd_data(),
wastd_works(),
wastdr_msg_abort(),
wastdr_msg_info(),
wastdr_msg_noop(),
wastdr_msg_success(),
wastdr_msg_warn(),
wastdr_settings(),
wastdr_setup()
testthat::expect_equal(absolute_angle(NA, 10), NA)
testthat::expect_equal(absolute_angle(10, NA), NA)
testthat::expect_equal(absolute_angle(0, 20), 20)
testthat::expect_equal(absolute_angle(20, 0), -20)
testthat::expect_equal(absolute_angle(10, 0), -10)
testthat::expect_equal(absolute_angle(20, 60), 40)
testthat::expect_equal(absolute_angle(350, 10), 20)
testthat::expect_equal(absolute_angle(10, 350), -20)