Last chance! 50% off unlimited learning
Sale ends in
Returns pt2
is in pt1
and pt2
, that is, returns 1 if pt2
is in
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).
IndNPEtetra(pt1, pt2, r, th, M = "CM", rv = NULL)
pt2
is in pt1
, that is, returns 1 if pt2
is in
A 3D point whose PE proximity region is constructed.
A 3D point. The function determines whether pt2
is inside the PE proximity region of
pt1
or not.
A positive real number which serves as the expansion parameter in PE proximity region;
must be
Four 3D points, stacked row-wise, each row representing a vertex of the tetrahedron.
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"
.
Index of the M
-vertex region containing the point, either 1,2,3,4
(default is NULL
).
Elvan Ceyhan
IndNPEstdtetra
, IndNPEtri
and IndNPEint
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