runif.sphere <- function(n, win=sphwin(type="sphere")) {
stopifnot(inherits(win, "sphwin") && win$type == "sphere")
theta <- acos(runif(n, -1, 1))
phi <- runif(n, 0, 2*pi)
output <- cbind(theta, phi) * win$rad
return(output)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.