Learn R Programming

pcds (version 0.1.2)

IndNPEtetra: The indicator for the presence of an arc from one 3D point to another 3D point for Proportional Edge Proximity Catch Digraphs (PE-PCDs)

Description

Returns \(I(\)pt2 is in \(N_{PE}(pt1,r))\) for 3D points pt1 and pt2, that is, returns 1 if pt2 is in \(N_{PE}(pt1,r)\), returns 0 otherwise, where N_PE(x,r) is the PE proximity region for point \(x\) with the expansion parameter \(r \ge 1\).

PE proximity region is constructed with respect to the tetrahedron th and vertex regions are based on the center M which is circumcenter ("CC") or center of mass ("CM") of th with default="CM". rv is the index of the vertex region pt1 resides, with default=NULL.

If pt1 and pt2 are distinct and either of them are outside th, it returns 0, but if they are identical, then it returns 1 regardless of their locations (i.e., it allows loops).

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

Usage

IndNPEtetra(pt1, pt2, r, th, M = "CM", rv = NULL)

Arguments

pt1

A 3D point whose PE proximity region is constructed.

pt2

A 3D point. The function determines whether pt2 is inside the PE proximity region of pt1 or not.

r

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

th

Four 3D points, stacked row-wise, each row representing a vertex of the tetrahedron.

M

The center to be used in the construction of the vertex regions in the tetrahedron, th. Currently it only takes "CC" for circumcenter and "CM" for center of mass; default="CM".

rv

Index of the M-vertex region containing the point, either 1,2,3,4 (default is NULL).

Value

\(I(\)pt2 is in \(N_{PE}(pt1,r))\) for pt1, that is, returns 1 if pt2 is in \(N_{PE}(pt1,r)\), returns 0 otherwise

References

See Also

IndNPEstdtetra, IndNPEtri and IndNPEint

Examples

Run this code
# NOT RUN {
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 also n<-20

dat<-runif.tetra(n,tetra)$g

M<-"CM"  #try also M<-"CC"
r<-1.5

IndNPEtetra(dat[1,],dat[2,],r,tetra)  #uses the default M="CM"
IndNPEtetra(dat[1,],dat[2,],r,tetra,M)

IndNPEtetra(dat[1,],dat[1,],r,tetra,M)

IndNPEtetra(c(.4,.4,.4),c(.5,.5,.5),r,tetra,M)

#or try
RV<-rv.tetraCC(dat[1,],tetra)$rv
IndNPEtetra(dat[1,],dat[5,],r,tetra,M,rv=RV)

IndNPEtetra(dat[1,],c(-1,-1,-1),r,tetra,M,rv=NULL)

IndNPEtetra(c(-1,-1,-1),dat[1,],r,tetra,M,rv=NULL)
IndNPEtetra(c(-1,-1,-1),c(-1,-1,-1),r,tetra,M)

P1<-c(.1,.1,.1)
P2<-c(.5,.5,.5)
IndNPEtetra(P1,P2,r,tetra,M)

# }

Run the code above in your browser using DataLab