| rel.verts.tri.nondegPE | R Documentation |
Returns the indices of the vertices
whose regions contain the points in data set Xp in
a triangle tri=(A,B,C)
and vertex regions are based on the center cent
which yields nondegenerate asymptotic
distribution of the domination number of PE-PCD
for uniform data in tri
for expansion parameter r in (1,1.5].
Vertices of triangle tri are labeled as 1,2,3
according to the row number the vertex is recorded
if a point in Xp is not inside tri,
then the function yields NA as output for that entry.
The corresponding vertex region is the polygon with the vertex, cent,
and projection points on the edges.
The center label cent values 1,2,3
correspond to the vertices M_1, M_2, and M_3;
with default 1 (see the examples for an illustration).
See also (\insertCiteceyhan:Phd-thesis,ceyhan:dom-num-NPE-Spat2011,ceyhan:comp-geo-2010,ceyhan:mcap2012;textualpcds).
rel.verts.tri.nondegPE(Xp, tri, r, cent = 1)
Xp |
A set of 2D points representing the set of data points for which indices of the vertex regions containing them are to be determined. |
tri |
A |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be in |
cent |
Index of the center
(as |
A list with two elements
rv |
Indices (i.e., a |
tri |
The vertices of the triangle,
where row number corresponds to the vertex index in |
Elvan Ceyhan
rel.verts.triCM, rel.verts.triCC,
and rel.verts.tri
A<-c(1,1); B<-c(2,0); C<-c(1.5,2);
Tr<-rbind(A,B,C);
r<-1.35
cent<-2
P<-c(1.4,1.0)
rel.verts.tri.nondegPE(P,Tr,r,cent)
n<-20 #try also n<-40
set.seed(1)
Xp<-runif.tri(n,Tr)$g
rel.verts.tri.nondegPE(Xp,Tr,r,cent)
rel.verts.tri.nondegPE(rbind(Xp,c(2,2)),Tr,r,cent)
rv<-rel.verts.tri.nondegPE(Xp,Tr,r,cent)
M<-center.nondegPE(Tr,r)[cent,];
Ds<-prj.nondegPEcent2edges(Tr,r,cent)
Xlim<-range(Tr[,1],Xp[,1])
Ylim<-range(Tr[,2],Xp[,2])
xd<-Xlim[2]-Xlim[1]
yd<-Ylim[2]-Ylim[1]
plot(Tr,pch=".",xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05))
polygon(Tr)
points(Xp,pch=".",col=1)
L<-rbind(M,M,M); R<-Ds
segments(L[,1], L[,2], R[,1], R[,2], lty = 2)
xc<-Tr[,1]+c(-.03,.05,.05)
yc<-Tr[,2]+c(-.06,.02,.05)
txt.str<-c("rv=1","rv=2","rv=3")
text(xc,yc,txt.str)
txt<-rbind(M,Ds)
xc<-txt[,1]+c(.02,.04,-.03,0)
yc<-txt[,2]+c(.07,.03,.05,-.07)
txt.str<-c("M","D1","D2","D3")
text(xc,yc,txt.str)
text(Xp,labels=factor(rv$rv))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.