| cl2CCvert.reg | R Documentation |
CC-vertex region
in a triangleAn object of class "Extrema".
Returns the closest data points among the data set, Xp,
to circumcenter, CC, in each CC-vertex region
in the triangle tri =T(A,B,C)=(vertex 1,vertex 2,vertex 3).
ch.all.intri is for checking whether all data points are
inside tri (default is FALSE).
If some of the data points are not inside tri
and ch.all.intri=TRUE, then the function yields
an error message.
If some of the data points are not inside tri
and ch.all.intri=FALSE, then the function yields
the closest points to CC among the data points
in each CC-vertex region of tri
(yields NA if
there are no data points inside tri).
See also (\insertCiteceyhan:Phd-thesis,ceyhan:mcap2012;textualpcds).
cl2CCvert.reg(Xp, tri, ch.all.intri = FALSE)
Xp |
A set of 2D points representing the set of data points. |
tri |
A |
ch.all.intri |
A logical argument (default= |
A list with the elements
txt1 |
Vertex labels are |
txt2 |
A short description of the distances
as |
type |
Type of the extrema points |
mtitle |
The |
ext |
The extrema points, here,
closest points to |
X |
The input data, |
num.points |
The number of data points, i.e., size of |
supp |
Support of the data points,
here, it is |
cent |
The center point used for construction of vertex regions |
ncent |
Name of the center, |
regions |
Vertex regions inside the triangle, |
region.names |
Names of the vertex regions
as |
region.centers |
Centers of mass of the vertex regions
inside |
dist2ref |
Distances from closest points
in each |
Elvan Ceyhan
cl2CCvert.reg.basic.tri, cl2edges.vert.reg.basic.tri,
cl2edgesMvert.reg, cl2edgesCMvert.reg,
and fr2edgesCMedge.reg.std.tri
A<-c(1,1); B<-c(2,0); C<-c(1.5,2);
Tr<-rbind(A,B,C);
n<-10 #try also n<-20
set.seed(1)
Xp<-runif.tri(n,Tr)$g
Ext<-cl2CCvert.reg(Xp,Tr)
Ext
summary(Ext)
plot(Ext)
c2CC<-Ext
CC<-circumcenter.tri(Tr) #the circumcenter
D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2;
Ds<-rbind(D1,D2,D3)
Xlim<-range(Tr[,1],Xp[,1])
Ylim<-range(Tr[,2],Xp[,2])
xd<-Xlim[2]-Xlim[1]
yd<-Ylim[2]-Ylim[1]
plot(A,pch=".",asp=1,xlab="",ylab="",
main="Closest Points in CC-Vertex Regions \n to the Circumcenter",
xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05))
polygon(Tr)
points(Xp)
L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds
segments(L[,1], L[,2], R[,1], R[,2], lty=2)
points(c2CC$ext,pch=4,col=2)
txt<-rbind(Tr,CC,Ds)
xc<-txt[,1]+c(-.07,.08,.06,.12,-.1,-.1,-.09)
yc<-txt[,2]+c(.02,-.02,.03,.0,.02,.06,-.04)
txt.str<-c("A","B","C","CC","D1","D2","D3")
text(xc,yc,txt.str)
Xp2<-rbind(Xp,c(.2,.4))
cl2CCvert.reg(Xp2,Tr,ch.all.intri = FALSE)
#gives an error message if ch.all.intri = TRUE since not all points are in the triangle
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.