Learn R Programming

pcds (version 0.1.4)

NCStri: The vertices of the Central Similarity (CS) Proximity Region in a general triangle

Description

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

CS proximity region is defined with respect to the triangle tri with expansion parameter \(t>0\) and edge 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.

Edge regions are labeled as 1,2,3 rowwise for the corresponding vertices of the triangle tri. re is the index of the edge 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:arc-density-CS;textualpcds).

Usage

NCStri(pt, tau, tri, M, re = NULL)

Value

Vertices of the triangular region which constitutes the CS proximity region with expansion parameter \(\tau>0\) and center M for a point pt

Arguments

pt

A 2D point whose CS proximity region is to be computed.

tau

A positive real number which serves as the expansion parameter in CS proximity region.

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.

re

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

Author

Elvan Ceyhan

References

See Also

NPEtri, NAStri, and IndNCStri

Examples

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

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

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

NCStri(dat[7,],tau,Tr,M)

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

P2<-c(1.8,.5)
NCStri(P2,tau,Tr,M)

P3<-c(1.7,.6)
NCStri(P3,tau,Tr,M)

#or try
re<-redges.tri.cent(P2,Tr,M)$re
NCStri(P2,tau,Tr,M,re)

dat.fr<-data.frame(a=Tr)
NCStri(P2,tau,dat.fr,M)

Run the code above in your browser using DataLab