R/rspml.R

Defines functions rspml

Documented in rspml

rspml <- function(n, mu, rads = TRUE) {
  y <- Rfast::matrnorm(n, 2) + rep(mu, rep(n, 2))
  y / sqrt( Rfast::rowsums(y^2) )  ## ESAG simulated values
  y <- ( atan(y[, 2]/y[, 1]) + pi * I(y[, 1] < 0) ) %% (2 * pi)
  if ( !rads )  y <- y * pi/180
  y
}

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.