runif.tri | R Documentation |
An object of class "Uniform"
.
Generates n
points uniformly in a given triangle, tri
runif.tri(n, tri)
n |
A positive integer representing the number of uniform points to be generated in the triangle. |
tri |
A |
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 of
the uniformly generated points, it is the triangle
|
gen.points |
The output set of generated points uniformly
in the 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 |
Elvan Ceyhan
runif.std.tri
, runif.basic.tri
,
and runif.multi.tri
## Not run:
n<-100
A<-c(1,1); B<-c(2,0); C<-c(1.5,2);
Tr<-rbind(A,B,C)
Xdt<-runif.tri(n,Tr)
Xdt
summary(Xdt)
plot(Xdt)
Xp<-Xdt$g
Xlim<-range(Tr[,1])
Ylim<-range(Tr[,2])
xd<-Xlim[2]-Xlim[1]
yd<-Ylim[2]-Ylim[1]
plot(Tr,pch=".",xlab="",ylab="",main="Uniform Points in One Triangle",
xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05))
polygon(Tr)
points(Xp)
xc<-Tr[,1]+c(-.02,.02,.02)
yc<-Tr[,2]+c(.02,.02,.04)
txt.str<-c("A","B","C")
text(xc,yc,txt.str)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.