tests/testthat/test_spheredist.R

library(spatstatsphere)
context("Distances on sphere.")

test_that("Distance on unit sphere is correct", {
  expect_equal(unitspheredist(-pi/2, 0, pi/2, 0), pi)
  expect_equal(unitspheredist(pi/4, 0, pi/4, 0), 0)
})
rubak/spatstatsphere documentation built on May 28, 2019, 9:56 a.m.