runif.std.tri.onesixth {pcds} | R Documentation |
Generation of Uniform Points in the first one-sixth of standard equilateral triangle
Description
An object of class "Uniform"
.
Generates n
points uniformly
in the first 1/6th of the standard equilateral triangle T_e=(A,B,C)
with vertices with A=(0,0)
; B=(1,0)
, C=(1/2,\sqrt{3}/2)
(see the examples below).
The first 1/6th of the standard equilateral triangle is the triangle with vertices
A=(0,0)
, (1/2,0)
, C=(1/2,\sqrt{3}/6)
.
Usage
runif.std.tri.onesixth(n)
Arguments
n |
a positive integer representing number of uniform points
to be generated
in the first one-sixth of |
Value
A list
with the elements
type |
The type of the point pattern |
mtitle |
The |
support |
The vertices of the support of the uniformly generated points |
gen.points |
The output set of uniformly generated points in the first 1/6th of the standard equilateral triangle. |
out.region |
The outer region for the one-sixth of |
desc.pat |
Description of the point pattern |
num.points |
The |
txt4pnts |
Description of the two numbers in |
xlimit , ylimit |
The ranges of the |
Author(s)
Elvan Ceyhan
See Also
runif.std.tri
, 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);
CM<-(A+B+C)/3;
D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2;
Ds<-rbind(D1,D2,D3)
nx<-100 #try also nx<-1000
#data generation step
set.seed(1)
Xdt<-runif.std.tri.onesixth(nx)
Xdt
summary(Xdt)
plot(Xdt,asp=1)
Xd<-Xdt$gen.points
#plot of the data with the regions in the equilateral triangle
Xlim<-range(Te[,1])
Ylim<-range(Te[,2])
xd<-Xlim[2]-Xlim[1]
yd<-Ylim[2]-Ylim[1]
plot(Te,asp=1,pch=".",xlim=Xlim+xd*c(-.01,.01),
ylim=Ylim+yd*c(-.01,.01),xlab=" ",ylab=" ",
main="first 1/6th of the \n standard equilateral triangle")
polygon(Te)
L<-Te; R<-Ds
segments(L[,1], L[,2], R[,1], R[,2], lty=2)
polygon(rbind(A,D3,CM),col=5)
points(Xd)
#letter annotation of the plot
txt<-rbind(A,B,C,CM,D1,D2,D3)
xc<-txt[,1]+c(-.02,.02,.02,.04,.05,-.03,0)
yc<-txt[,2]+c(.02,.02,.02,.03,0,.03,-.03)
txt.str<-c("A","B","C","CM","D1","D2","D3")
text(xc,yc,txt.str)