runif.circ {nnspat} | R Documentation |
Generation of Uniform Points in a Circle
Description
An object of class "SpatPatterns"
.
Generates n
2D points uniformly in the circle with center=cent
and radius=rad
using the rejection
sampling approach (i.e., the function generates points in the smallest square containing the circle, keeping
only the points inside the circle until n
points are generated).
The defaults for cent=c(0,0)
and rad=1
.
Usage
runif.circ(n, cent = c(0, 0), rad = 1)
Arguments
n |
A positive integer representing the number of points to be generated uniformly in the circle |
cent |
A 2D point representing the center of the circle, with default= |
rad |
A positive real number representing the radius of the circle. |
Value
A list
with the elements
pat.type |
|
type |
The type of the point pattern |
parameters |
center of the circle, |
lab |
The class labels of the generated points, |
init.cases |
The initial points, |
gen.points |
The output set of generated points uniform in the circle. |
ref.points |
The input set of reference points, it is |
desc.pat |
Description of the point pattern |
mtitle |
The |
num.points |
The number of generated points. |
xlimit , ylimit |
The possible ranges of the |
Author(s)
Elvan Ceyhan
See Also
Examples
n<-20 #or try sample(1:20,1); #try also 10, 100, or 1000;
r<-.1; #try also r<-.3 or .5
cent<-c(1,2)
#data generation
Xdat<-runif.circ(n,cent,r) #generated data
Xdat
summary(Xdat)
plot(Xdat,asp=1)
plot(Xdat)