Learn R Programming

pcds (version 0.1.2)

Gam3PEstdTetra: The indicator for three 3D points constituting a dominating set for Proportional Edge Proximity Catch Digraphs (PE-PCDs) - standard regular tetrahedron case

Description

Returns \(I(\{\)pt1,pt2,pt3} is a dominating set of the PE-PCD\()\) where the vertices of the PE-PCD are the 3D data set Dt in the standard regular tetrahedron \(T_h=T((0,0,0),(1,0,0),(1/2,\sqrt{3}/2,0),(1/2,\sqrt{3}/6,\sqrt{6}/3))\), that is, returns 1 if {pt1,pt2,pt3} is a dominating set of PE-PCD, returns 0 otherwise.

Point, pt1, is in the region of vertex rv1 (default is NULL), point, pt2, is in the region of vertex rv2 (default is NULL); point, pt3), is in the region of vertex rv3) (default is NULL); vertices (and hence rv1, rv2 and rv3) are labeled as 1,2,3,4 in the order they are stacked row-wise in \(T_h\).

PE proximity region is constructed with respect to the tetrahedron \(T_h\) with expansion parameter \(r \ge 1\) and vertex regions are based on center of mass \(CM\) (equivalent to circumcenter in this case).

ch.data.pnts is for checking whether points pt1, pt2 and pt3 are all data points in Dt or not (default is FALSE), so by default this function checks whether the points pt1, pt2 and pt3 would constitute a dominating set if they actually were all in the data set.

See also (ceyhan:Phd-thesis,ceyhan:comp-geo-2010;textualpcds).

Usage

Gam3PEstdTetra(
  pt1,
  pt2,
  pt3,
  Dt,
  r,
  rv1 = NULL,
  rv2 = NULL,
  rv3 = NULL,
  ch.data.pnts = FALSE
)

Arguments

pt1, pt2, pt3

Three 3D points to be tested for constituting a dominating set of the PE-PCD.

Dt

A set of 3D points which constitutes the vertices of the PE-PCD.

r

A positive real number which serves as the expansion parameter in PE proximity region; must be \(\ge 1\).

rv1, rv2, rv3

The indices of the vertices whose regions contains pt1, pt2 and pt3, respectively. They take the vertex labels as 1,2,3,4 as in the row order of the vertices in \(T_h\) (default is NULL for all).

ch.data.pnts

A logical argument for checking whether points pt1 and pt2 are data points in Dt or not (default is FALSE).

Value

\(I(\{\)pt1,pt2,pt3} is a dominating set of the PE-PCD\()\) where the vertices of the PE-PCD are the 3D data set Dt), that is, returns 1 if {pt1,pt2,pt3} is a dominating set of PE-PCD, returns 0 otherwise

References

See Also

Gam3PEtetra

Examples

Run this code
# NOT RUN {
set.seed(123)
A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3)
tetra<-rbind(A,B,C,D)
n<-10 #try 20, 40, 100 (larger n may take a long time)
dat<-runif.stdtetra(n)$g  #try also dat<-cbind(runif(n),runif(n),runif(n))
r<-1.25

Gam3PEstdTetra(dat[1,],dat[2,],dat[3,],dat,r)

Gam3PEstdTetra(dat[1,],dat[2,],dat[2,],dat,r)

Gam3PEstdTetra(dat[1,],c(1,1,1),dat[3,],dat,r)

Gam3PEstdTetra(c(-1,1,1),c(1,1,1),c(1,1,-1),rbind(c(-1,1,1),c(1,1,1),c(1,1,-1)),r)

ind.gam3<-vector()
for (i in 1:(n-2))
 for (j in (i+1):(n-1))
   for (k in (j+1):n)
 {if (Gam3PEstdTetra(dat[i,],dat[j,],dat[k,],dat,r)==1)
  ind.gam3<-rbind(ind.gam3,c(i,j,k))}

ind.gam3

#or try
rv1<-rv.tetraCC(dat[1,],tetra)$rv; rv2<-rv.tetraCC(dat[2,],tetra)$rv;
rv3<-rv.tetraCC(dat[3,],tetra)$rv
Gam3PEstdTetra(dat[1,],dat[2,],dat[3,],dat,r,rv1,rv2,rv3)

#or try
rv1<-rv.tetraCC(dat[1,],tetra)$rv;
Gam3PEstdTetra(dat[1,],dat[2,],dat[3,],dat,r,rv1)

#or try
rv2<-rv.tetraCC(dat[2,],tetra)$rv
Gam3PEstdTetra(dat[1,],dat[2,],dat[3,],dat,r,rv2=rv2)

P1<-c(.1,.1,.1)
P2<-c(.3,.3,.3)
P3<-c(.4,.1,.2)
Gam3PEstdTetra(P1,P2,P3,dat,r)

dat.fr<-data.frame(a=dat)
Gam3PEstdTetra(P1,P2,P3,dat.fr,r)

Gam3PEstdTetra(dat[1,],c(1,1,1),dat[3,],dat,r,ch.data.pnts = FALSE)
#gives an error message if ch.data.pnts = TRUE since not all points are data points in Dt

# }

Run the code above in your browser using DataLab