Learn R Programming

pcds (version 0.1.4)

IndCSTeSet: The indicator for the presence of an arc from a point in set S to the point pt for Central Similarity Proximity Catch Digraphs (CS-PCDs) - standard equilateral triangle case

Description

Returns \(I(\)pt in \(N_{CS}(x,t)\) for some \(x\) in S\()\), that is, returns 1 if pt is in \(\cup_{x in S} N_{CS}(x,t)\), returns 0 otherwise, CS proximity region is constructed with respect to the standard equilateral triangle \(T_e=T(A,B,C)=T((0,0),(1,0),(1/2,\sqrt{3}/2))\) with the expansion parameter \(t>0\) and edge regions are based on center \(M=(m_1,m_2)\) in Cartesian coordinates or \(M=(\alpha,\beta,\gamma)\) in barycentric coordinates in the interior of \(T_e\); default is \(M=(1,1,1)\) i.e., the center of mass of \(T_e\) (which is equivalent to circumcenter of \(T_e\)).

Edges of \(T_e\), \(AB\), \(BC\), \(AC\), are also labeled as edges 3, 1, and 2, respectively. If pt is not in S and either pt or all points in S are outside \(T_e\), it returns 0, but if pt is in S, then it always returns 1 regardless of its location (i.e., loops are allowed).

See also (ceyhan:mcap2012;textualpcds).

Usage

IndCSTeSet(S, pt, t, M = c(1, 1, 1))

Value

\(I(\)pt is in \(\cup_{x in S} N_{CS}(x,t))\), that is, returns 1 if pt is in S or inside \(N_{CS}(x,t)\) for at least one \(x\) in S, returns 0 otherwise. CS proximity region is constructed with respect to the standard equilateral triangle \(T_e=T(A,B,C)=T((0,0),(1,0),(1/2,\sqrt{3}/2))\) with M-edge regions.

Arguments

S

A set of 2D points. Presence of an arc from a point in S to point pt is checked by the function.

pt

A 2D point. Presence of an arc from a point in S to point pt is checked by the function.

t

A positive real number which serves as the expansion parameter in CS proximity region in the standard equilateral triangle \(T_e=T((0,0),(1,0),(1/2,\sqrt{3}/2))\).

M

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

Author

Elvan Ceyhan

References

See Also

IndNCStriSet, IndCSTe, IndNCStri, and IndNPETeSet

Examples

Run this code
A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2);
Te<-rbind(A,B,C);
n<-10

set.seed(1)
dat<-runifTe(n)$gen.points

M<-as.numeric(runifTe(1)$g)  #try also M<-c(.6,.2)

t<-.5

S<-rbind(dat[1,],dat[2,])  #try also S<-c(.5,.5)
IndCSTeSet(S,dat[3,],t,M)
IndCSTeSet(S,dat[3,],t=1,M)
IndCSTeSet(S,dat[3,],t=1.5,M)

S<-rbind(dat[1,],dat[2,],dat[3,],dat[5,])
IndCSTeSet(S,dat[3,],t,M)

IndCSTeSet(S,dat[6,],t,M)
IndCSTeSet(S,dat[6,],t=.25,M)

S<-rbind(c(.1,.1),c(.3,.4),c(.5,.3))
IndCSTeSet(S,dat[3,],t,M)

IndCSTeSet(c(.2,.5),dat[2,],t,M)
IndCSTeSet(dat,c(.2,.5),t,M)
IndCSTeSet(dat,dat[2,],t)
IndCSTeSet(c(.2,.5),c(.2,.5),t,M)
IndCSTeSet(dat[5,],dat[2,],t,M)

S<-rbind(dat[1,],dat[2,],dat[3,],dat[5,],c(.2,.5))
IndCSTeSet(S,dat[3,],t,M)

P<-c(.4,.2)
S<-dat[c(1,3,4),]
IndCSTeSet(dat,P,t,M)

IndCSTeSet(rbind(S,S),P,t,M)

dat.fr<-data.frame(a=S)
IndCSTeSet(dat.fr,P,t,M)

Run the code above in your browser using DataLab