R/rcircbeta.R

Defines functions rcircbeta

Documented in rcircbeta

rcircbeta <- function(n, m, a, b, rads = TRUE) {
  x <- rbeta(n, a, b)
  y <- acos( 2 * x - 1 )
  u <- Rfast2::Runif(n)
  x <- y * (u < 0.5) + (2 * pi - y) * (u > 0.5) + m
  if (!rads)  x <- x/pi * 180
  x
}

Try the Directional package in your browser

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

Directional documentation built on Oct. 12, 2023, 1:07 a.m.