tests/testthat/test-angle.R

coords1 = matrix(0, nrow = 8, ncol = 2)
coords2 = cbind(c(2, 2, 0, -2, -2, -2, 0, 2), c(0, 2, 2, 2, 0, -2, -2, -2))

test_that("check accuracy of angle2d function", {
  expect_equal(angle2d(coords1, coords2, invert = FALSE),
                c(0,  45,  90, 135,   0,  45,  90, 135))
})

Try the gear package in your browser

Any scripts or data that you put into this service are public.

gear documentation built on April 14, 2020, 5:12 p.m.