Learn R Programming

pcds (version 0.1.2)

NPEtetra: The vertices of the Proportional Edge (PE) Proximity Region in a tetrahedron

Description

Returns the vertices of the PE proximity region (which is itself a tetrahedron) for a point in the tetrahedron th.

PE proximity region is defined with respect to the tetrahedron th with expansion parameter \(r \ge 1\) and vertex regions based on the center M which is circumcenter ("CC") or center of mass ("CM") of th with default="CM".

Vertex regions are labeled as 1,2,3,4 rowwise for the vertices of the tetrahedron th. rv is the index of the vertex region pt resides, with default=NULL. If pt is outside of th, it returns NULL for the proximity region.

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

Usage

NPEtetra(pt, r, th, M = "CM", rv = NULL)

Arguments

pt

A 3D point whose PE proximity region is to be computed.

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 vertex region containing the point, either 1,2,3,4 (default is NULL).

Value

Vertices of the tetrahedron which constitutes the PE proximity region with expansion parameter r and circumcenter (or center of mass) for a point pt in the tetrahedron

References

See Also

NPEstdtetra, NPEtri and NPEint

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

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

NPEtetra(dat[5,],r,tetra,M)

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

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

NPEtetra(c(-1,-1,-1),r,tetra,M,rv=NULL)

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

# }

Run the code above in your browser using DataLab