Learn R Programming

pcds (version 0.1.4)

NPEtri: The vertices of the Proportional Edge (PE) Proximity Region in a general triangle

Description

Returns the vertices of the PE proximity region (which is itself a triangle) for a point in the triangle tri\(=T(A,B,C)=\)(rv=1,rv=2,rv=3).

PE proximity region is defined with respect to the triangle tri with expansion parameter \(r \ge 1\) and vertex regions based on center \(M=(m_1,m_2)\) in Cartesian coordinates or \(M=(\alpha,\beta,\gamma)\) in barycentric coordinates in the interior of the triangle tri or based on the circumcenter of tri; default is \(M=(1,1,1)\) i.e., the center of mass of tri.

Vertex regions are labeled as \(1,2,3\) rowwise for the vertices of the triangle tri. 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:arc-density-PE,ceyhan:dom-num-NPE-Spat2011;textualpcds).

Usage

NPEtri(pt, r, tri, M = c(1, 1, 1), rv = NULL)

Value

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

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 \(\ge 1\).

tri

Three 2D points, stacked row-wise, each row representing a vertex of the triangle.

M

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

rv

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

Author

Elvan Ceyhan

References

See Also

NPEbastri, NAStri, NCStri and IndNPEtri

Examples

Run this code
A<-c(1,1); B<-c(2,0); C<-c(1.5,2);
Tr<-rbind(A,B,C);

M<-as.numeric(runif.tri(1,Tr)$g)  #try also M<-c(1.6,1.0)

r<-1.5

n<-10
set.seed(1)
dat<-runif.tri(n,Tr)$g

NPEtri(dat[7,],r,Tr,M)

P1<-as.numeric(runif.tri(1,Tr)$g)  #try also P1<-c(.4,.2)
NPEtri(P1,r,Tr,M)

P2<-c(1.8,.5)
NPEtri(P2,r,Tr,M)

P3<-c(1.7,.6)
NPEtri(P3,r,Tr,M)

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

P1<-c(1.4,1.2)
P2<-c(1.5,1.26)
NPEtri(P1,r,Tr,M)
NPEtri(P2,r,Tr,M)

#or try
Rv<-rv.tri.cent(P1,Tr,M)$rv
NPEtri(P1,r,Tr,M,Rv)

dat.fr<-data.frame(a=Tr)
NPEtri(P2,r,dat.fr,M)

Run the code above in your browser using DataLab