edge.reg.triCM {pcds} | R Documentation |
The vertices of the CM
-edge region in a triangle
that contains the point
Description
Returns the edge whose region contains point, p
, in
the triangle tri
=T(A,B,C)
with edge regions based on center of mass CM=(A+B+C)/3
.
This function is related to rel.edge.triCM
,
but unlike rel.edge.triCM
the related edges are given as vertices ABC
for re=3
, as BCA
for re=1
and as CAB
for re=2
where edges are labeled as 3 for edge AB
,
1 for edge BC
,
and 2 for edge AC
.
The vertices are given one vertex in each row in the output,
e.g., ABC
is printed as rbind(A,B,C)
,
where row 1 has the entries of vertex A,
row 2 has the entries of vertex B,
and row 3 has the entries of vertex C.
If the point, p
, is not inside tri
,
then the function yields NA
as output.
Edge region for BCA is the triangle T(B,C,CM)
,
edge region CAB is T(A,C,CM)
, and edge region ABC is T(A,B,CM)
.
See also (Ceyhan (2005, 2010)).
Usage
edge.reg.triCM(p, tri)
Arguments
p |
A 2D point for which |
tri |
A |
Value
The CM
-edge region that contains point,
p
in the triangle tri
.
The related edges are given as
vertices ABC
for re=3
,
as BCA
for re=1
and as CAB
for re=2
where edges are labeled as 3
for edge AB
, 1 for edge BC
, and 2 for edge AC
.
Author(s)
Elvan Ceyhan
References
Ceyhan E (2005).
An Investigation of Proximity Catch Digraphs in Delaunay Tessellations, also available as technical monograph titled Proximity Catch Digraphs: Auxiliary Tools, Properties, and Applications.
Ph.D. thesis, The Johns Hopkins University, Baltimore, MD, 21218.
Ceyhan E (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Ceyhan E (2012).
“An investigation of new graph invariants related to the domination number of random proximity catch digraphs.”
Methodology and Computing in Applied Probability, 14(2), 299-334.
See Also
rel.edge.tri
, rel.edge.triCM
,
rel.edge.basic.triCM
, rel.edge.basic.tri
,
rel.edge.std.triCM
, and edge.reg.triCM
Examples
A<-c(1,1); B<-c(2,0); C<-c(1.5,2);
Tr<-rbind(A,B,C);
P<-c(.4,.2) #try also P<-as.numeric(runif.tri(1,Tr)$g)
edge.reg.triCM(P,Tr)
P<-c(1.8,.5)
edge.reg.triCM(P,Tr)
CM<-(A+B+C)/3
p1<-(A+B+CM)/3
p2<-(B+C+CM)/3
p3<-(A+C+CM)/3
Xlim<-range(Tr[,1])
Ylim<-range(Tr[,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)
L<-Tr; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE)
segments(L[,1], L[,2], R[,1], R[,2], lty = 2)
txt<-rbind(Tr,CM,p1,p2,p3)
xc<-txt[,1]+c(-.02,.02,.02,-.05,0,0,0)
yc<-txt[,2]+c(.02,.02,.02,.02,0,0,0)
txt.str<-c("A","B","C","CM","re=T(A,B,CM)","re=T(B,C,CM)","re=T(A,C,CM)")
text(xc,yc,txt.str)