| runifdisc | R Documentation |
Generate a random point pattern
containing n independent uniform random points
in a circular disc.
runifdisc(n, radius=1, centre=c(0,0), ..., nsim=1, drop=TRUE, boxed=FALSE)
n |
Number of points. |
radius |
Radius of the circle. |
centre |
Coordinates of the centre of the circle. |
... |
Arguments passed to |
nsim |
Number of simulated realisations to be generated. |
drop |
Logical. If |
boxed |
Logical value indicating whether to replace the disc window by a square window, for computational efficiency. |
This function generates n independent random points,
uniformly distributed in a circular disc.
It is faster (for a circular window) than the general
code used in runifpoint.
To generate random points in an ellipse, first generate points in a
circle using runifdisc,
then transform to an ellipse using affine,
as shown in the examples.
To generate random points in other windows, use
runifpoint.
To generate non-uniform random points, use rpoint.
A point pattern (an object of class "ppp")
if nsim=1, or a list of point patterns if nsim > 1.
The random point coordinates are generated by a very fast algorithm.
Computation time includes the time taken to construct
the circular window containing the resulting point pattern,
which is generated by disc. Arguments passed to
disc control the accuracy of the polygonal
approximation to the circle, and therefore affect the computation
time.
If boxed=TRUE, the circular window is not constructed,
and is replaced by a square window, which is much faster to compute.
The random points are still generated uniformly inside the disc by
the same fast algorithm.
and \rolf.
disc,
runifpoint,
rpoint
# 100 random points in the unit disc
plot(runifdisc(100))
# 42 random points in the ellipse with major axis 3 and minor axis 1
X <- runifdisc(42)
Y <- affine(X, mat=diag(c(3,1)))
plot(Y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.