Learn R Programming

pcds (version 0.1.2)

IndNCStri.alt: An alternative to the function IndNCStri which yields 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 \(N_{CS}(pt1,t)\), returns 0 otherwise, where \(N_{CS}(x,t)\) is the CS proximity region for point \(x\) with the expansion parameter \(t>0\).

CS proximity region is constructed with respect to the triangle tri and edge regions are based on the center of mass, \(CM\). re is the index of the \(CM\)-edge region pt resides, with default=NULL but must be provided as vertices \((y_1,y_2,y_3)\) for \(re=3\) as rbind(y2,y3,y1) for \(re=1\) and as rbind(y1,y3,y2) for \(re=2\) for triangle \(T(y_1,y_2,y_3)\).

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.alt(pt1, pt2, t, tri, 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.

t

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.

re

Index of the \(CM\)-edge region containing the point pt, either 1,2,3 or NULL, default=NULL but must be provided (row-wise) as vertices \((y_1,y_2,y_3)\) for re=3 as \((y_2,y_3,y_1)\) for re=1 and as \((y_1,y_3,y_2)\) for re=2 for triangle \(T(y_1,y_2,y_3)\).

Value

\(I(\)pt2 is in \(N_{CS}(pt1,t))\) for pt1, that is, returns 1 if pt2 is in \(N_{CS}(pt1,t)\), 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.6,2);
Tr<-rbind(A,B,C);
t<-1.5

P1<-c(.4,.2)
P2<-c(1.8,.5)
IndNCStri(P1,P2,t,Tr,M=c(1,1,1))
IndNCStri.alt(P1,P2,t,Tr)

IndNCStri(P1,P1,t,Tr,M=c(1,1,1))
IndNCStri.alt(P1,P1,t,Tr)

IndNCStri(P2,P1,t,Tr,M=c(1,1,1))
IndNCStri.alt(P2,P1,t,Tr)

IndNCStri(P2,P2,t,Tr,M=c(1,1,1))
IndNCStri.alt(P2,P2,t,Tr)

P3<-c(1.7,.6)
IndNCStri(P2,P3,t,Tr,M=c(1,1,1))
IndNCStri.alt(P2,P3,t,Tr)

IndNCStri(P3,P2,t,Tr,M=c(1,1,1))
IndNCStri.alt(P3,P2,t,Tr)

#or try
re<-redges.triCM(P1,Tr)$re
IndNCStri(P1,P2,t,Tr,M=c(1,1,1),re)
IndNCStri.alt(P1,P2,t,Tr,re)

P2<-c(1.85,.5); P3<-c(1.7,.6)
IndNCStri.alt(P2,P3,t,Tr)

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

# }

Run the code above in your browser using DataLab