R/runif.wedge.R

Defines functions runif.wedge

Documented in runif.wedge

runif.wedge <- function(n, win) {
	stopifnot(inherits(win, "sphwin") && win$type == "wedge")
	theta <- acos(runif(n, -1, 1))
	phi1 <- runif(n, 0, win$param[1])
	phi.rot1 <- (phi1 + win$param[2]) %% (2*pi)
	output <- rot.sphere(cbind(theta, phi.rot1), northpole=win$ref, inverse=TRUE)
	output
}
baddstats/spherstat documentation built on Feb. 6, 2023, 1:45 a.m.