R/rcipc.R

Defines functions rcipc

Documented in rcipc

rcipc <- function(n, mu = NULL, omega, g, rads = TRUE) {
  if ( is.null(mu) ) {
    if ( !rads )  omega <- omega * pi/180
    mu <- g * c( cos(omega), sin(omega) )
  } 
  x <- Rfast::rmvt(n, mu, diag(2), 1)
  x <- x / sqrt( Rfast::rowsums(x^2) )
  ( atan(x[, 2]/x[, 1]) + pi * I(x[, 1] < 0) ) %% (2 * pi)
}  

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.