Learn R Programming

pcds (version 0.1.2)

IndNCStri: The indicator for the presence of an arc from one point to another for Central Similarity Proximity Catch Digraphs (CS-PCDs)

Description

Returns \(I(\)pt2 is in \(N_{CS}(pt1,t))\) for points pt1 and pt2, that is, returns 1 if pt2 is in \(NCS(pt1,\tau)\), returns 0 otherwise, where \(N_{CS}(x,\tau)\) is the CS proximity region for point \(x\) with the expansion parameter \(\tau>0\).

CS proximity region is constructed with respect to the triangle tri and edge regions are based on the center, \(M=(m_1,m_2)\) in Cartesian coordinates or \(M=(\alpha,\beta,\gamma)\) in barycentric coordinates in the interior of tri or based on the circumcenter of tri. re is the index of the edge region pt resides, with default=NULL

If pt1 and pt2 are distinct and either of them are outside tri, 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:arc-density-CS,ceyhan:test2014;textualpcds).

Usage

IndNCStri(pt1, pt2, tau, tri, M, re = NULL)

Arguments

pt1

A 2D point whose CS proximity region is constructed.

pt2

A 2D point. The function determines whether pt2 is inside the CS proximity region of pt1 or not.

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).

Value

I(pt2 is in \(NCS(pt1,\tau)\)) for pt1, that is, returns 1 if pt2 is in \(NCS(pt1,\tau)\), returns 0 otherwise

References

See Also

IndNAStri, IndNPEtri, IndNCStri, and IndCSTe

Examples

Run this code
# NOT RUN {
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

IndNCStri(dat[1,],dat[2,],tau,Tr,M)

P1<-as.numeric(runif.tri(1,Tr)$g)
P2<-as.numeric(runif.tri(1,Tr)$g)
IndNCStri(P1,P2,tau,Tr,M)

P1<-c(.4,.2)
P2<-c(1.8,.5)
IndNCStri(P1,P2,tau,Tr,M)
IndNCStri(P2,P1,tau,Tr,M)

IndNCStri(P1,P1,tau,Tr,M)
IndNCStri(P2,P2,tau,Tr,M)

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

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

P2<-c(1.8,.5)
P3<-c(1.7,.6)
IndNCStri(P2,P3,tau,Tr,M)

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

# }

Run the code above in your browser using DataLab