Create and export headings
hdg_norm(hdg) uv(u, v) uv_norm(uv) uv_from_hdg(hdg) hdg_from_uv(uv) rad_from_hdg(hdg) hdg_from_rad(rad)
hdg | A heading in degrees, where 0 is north,
90 is east, 180 is south, and 270 is west. Values
outside the range [0-360) are coerced to this range
using |
---|---|
uv, u, v | A data.frame with columns |
rad | An angle in radians such that a |
hdg_norm(-10:10)#> [1] 350 351 352 353 354 355 356 357 358 359 0 1 2 3 4 5 6 7 8 #> [20] 9 10hdg_from_uv(uv(1, 0))#> [1] 90uv_from_hdg(5:10)#> u v #> 1 0.08715574 0.9961947 #> 2 0.10452846 0.9945219 #> 3 0.12186934 0.9925462 #> 4 0.13917310 0.9902681 #> 5 0.15643447 0.9876883 #> 6 0.17364818 0.9848078uv_norm(uv(2, 0))#> u v #> 1 1 0