runif.std.tri {pcds} | R Documentation |
Generation of Uniform Points in the Standard Equilateral Triangle
Description
An object of class "Uniform"
.
Generates n
points uniformly
in the standard equilateral triangle T_e=T(A,B,C)
with vertices A=(0,0)
, B=(1,0)
, and C=(1/2,\sqrt{3}/2)
.
Usage
runif.std.tri(n)
Arguments
n |
A positive integer representing the number of uniform points
to be generated in the standard equilateral triangle |
Value
A list
with the elements
type |
The type of the pattern from which points are to be generated |
mtitle |
The |
tess.points |
The vertices of the support region of
the uniformly generated points, it is the
standard equilateral triangle |
gen.points |
The output set of generated points uniformly
in the standard equilateral triangle |
out.region |
The outer region which contains the support region,
|
desc.pat |
Description of the point pattern from which points are to be generated |
num.points |
The |
txt4pnts |
Description of the two numbers in |
xlimit , ylimit |
The ranges of the |
Author(s)
Elvan Ceyhan
See Also
runif.basic.tri
, runif.tri
,
and runif.multi.tri
Examples
A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2);
Te<-rbind(A,B,C);
n<-100
set.seed(1)
Xdt<-runif.std.tri(n)
Xdt
summary(Xdt)
plot(Xdt,asp=1)
Xlim<-range(Te[,1])
Ylim<-range(Te[,2])
xd<-Xlim[2]-Xlim[1]
yd<-Ylim[2]-Ylim[1]
Xp<-runif.std.tri(n)$gen.points
plot(Te,asp=1,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.01,.01),
ylim=Ylim+yd*c(-.01,.01))
polygon(Te)
points(Xp)