50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


pcds (version 0.1.1)

NPEbastri: The vertices of the Proportional Edge (PE) Proximity Region in a basic triangle

Description

Returns the vertices of the PE proximity region (which is itself a triangle) for a point in the basic triangle Tb=T((0,0),(1,0),(c1,c2))=(rv=1,rv=2,rv=3).

PE proximity region is defined with respect to the basic triangle Tb with expansion parameter r1 and vertex regions based on center M=(m1,m2) in Cartesian coordinates or M=(α,β,γ) in barycentric coordinates in the interior of the basic triangle Tb or based on the circumcenter of Tb; default is M=(1,1,1) i.e. the center of mass of Tb.

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

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

Usage

NPEbastri(pt, r, c1, c2, M = c(1, 1, 1), rv = NULL)

Arguments

pt

A 2D 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 1.

c1, c2

Positive real numbers representing the top vertex in basic triangle Tb=T((0,0),(1,0),(c1,c2)), c1 must be in [0,1/2], c2>0 and (1c1)2+c221.

M

A 2D point in Cartesian coordinates or a 3D point in barycentric coordinates which serves as a center in the interior of the basic triangle Tb or the circumcenter of Tb; default is M=(1,1,1) i.e. the center of mass of Tb.

rv

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

Value

Vertices of the triangular region which constitutes the PE proximity region with expansion parameter r and center M for a point pt

References

See Also

NPEtri, NAStri, NCStri and IndNPEbastri

Examples

Run this code
# NOT RUN {
c1<-.4; c2<-.6
A<-c(0,0); B<-c(1,0); C<-c(c1,c2);
Tb<-rbind(A,B,C);

M<-as.numeric(runif.bastri(1,c1,c2)$g)  #try also M<-c(.6,.2)

r<-2

P1<-as.numeric(runif.bastri(1,c1,c2)$g)  #try also P1<-c(.4,.2)
NPEbastri(P1,r,c1,c2,M)

#or try
Rv<-rv.bastri.cent(P1,c1,c2,M)$rv
NPEbastri(P1,r,c1,c2,M,Rv)

P2<-c(1.8,.5)
NPEbastri(P2,r,c1,c2,M)

P3<-c(1.7,.6)
NPEbastri(P3,r,c1,c2,M)

M<-c(1.3,1.3)
r<-2

# }
# NOT RUN {
P1<-c(1.4,1.2)
P2<-c(1.5,1.26)
NPEbastri(P1,r,c1,c2,M)
#gives an error since center is not the circumcenter or not in the interior of the triangle
NPEbastri(P2,r,c1,c2,M)
#gives an error since center is not the circumcenter or not in the interior of the triangle
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab