rel.edge.basic.triCM {pcds} | R Documentation |
The index of the CM
-edge region
in a standard basic triangle form that contains a point
Description
Returns the index of the edge
whose region contains point, p
, in the
standard basic triangle form
T_b=T(A=(0,0),B=(1,0),C=(c_1,c_2)
where c_1
is in [0,1/2]
,
c_2>0
and (1-c_1)^2+c_2^2 \le 1
with
edge regions based on center of mass CM=(A+B+C)/3
.
Edges are labeled as 3 for edge AB
,
1 for edge BC
, and 2 for edge AC
.
If the point, p
, is not inside tri
,
then the function yields NA
as output.
Edge region 1 is the triangle T(B,C,CM)
,
edge region 2 is T(A,C,CM)
,
and edge region 3 is T(A,B,CM)
.
Any given triangle can be mapped to the standard basic triangle form by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence, standard basic triangle form is useful for simulation studies under the uniformity hypothesis.
See also (Ceyhan (2005, 2010); Ceyhan et al. (2007)).
Usage
rel.edge.basic.triCM(p, c1, c2)
Arguments
p |
A 2D point for which |
c1 , c2 |
Positive real numbers
which constitute the upper vertex of the standard basic triangle form
(i.e., the vertex adjacent to the shorter edges of |
Value
A list
with three elements
re |
Index of the |
tri |
The vertices of the triangle,
where row labels are |
desc |
Description of the edge labels |
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.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
See Also
rel.edge.triCM
, rel.edge.tri
,
rel.edge.basic.tri
, rel.edge.std.triCM
, and edge.reg.triCM
Examples
c1<-.4; c2<-.6
P<-c(.4,.2)
rel.edge.basic.triCM(P,c1,c2)
A<-c(0,0);B<-c(1,0);C<-c(c1,c2);
Tb<-rbind(A,B,C)
CM<-(A+B+C)/3
rel.edge.basic.triCM(A,c1,c2)
rel.edge.basic.triCM(B,c1,c2)
rel.edge.basic.triCM(C,c1,c2)
rel.edge.basic.triCM(CM,c1,c2)
n<-20 #try also n<-40
Xp<-runif.basic.tri(n,c1,c2)$g
re<-vector()
for (i in 1:n)
re<-c(re,rel.edge.basic.triCM(Xp[i,],c1,c2)$re)
re
Xlim<-range(Tb[,1],Xp[,1])
Ylim<-range(Tb[,2],Xp[,2])
xd<-Xlim[2]-Xlim[1]
yd<-Ylim[2]-Ylim[1]
plot(Tb,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05))
points(Xp,pch=".")
polygon(Tb)
L<-Tb; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE)
segments(L[,1], L[,2], R[,1], R[,2], lty = 2)
text(Xp,labels=factor(re))
txt<-rbind(Tb,CM)
xc<-txt[,1]+c(-.03,.03,.02,0)
yc<-txt[,2]+c(.02,.02,.02,-.04)
txt.str<-c("A","B","C","CM")
text(xc,yc,txt.str)