RandomSphere
任意次元の、指定半径多次元球面上の均一分布の発生
RandomSphere(6)
RandomSphere<-
function (df = 3, r = 1, n = 100)
{
rs <- matrix(rnorm(df * n), nrow = n)
rs/sqrt(apply(rs^2, 1, sum)) * r
}
\name{RandomSphere}
\alias{RandomSphere}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
RandomSphere
}
\description{
任意次元の、指定半径多次元球面上の均一分布の発生
}
\usage{
RandomSphere(4)
}
\arguments{
df = 3, r = 1, n = 100
\item{df}{自然数 次元}
\item{r}{半径}
\item{n}{乱数点の数}
}
%- maybe also 'usage' for other objects documented here.
\details{
%% ~~ If necessary, more details than the description above ~~
}
\value{
点の数の行x次元の列の行列
}
\references{
%% ~put references to the literature/web site here ~
}
\author{
%% ~~who you are~~
}
\note{
%% ~~further notes~~
}
%% ~Make other sections like Warning with \section{Warning }{....} ~
\seealso{
}
\examples{
df<-3
x<-RandomSphere(df)
plot(as.data.frame(x))
}