IarcASset2pnt.tri: The indicator for the presence of an arc from a point in set...

View source: R/ArcSliceFunctions.R

IarcASset2pnt.triR Documentation

The indicator for the presence of an arc from a point in set S to the point p for Arc Slice Proximity Catch Digraphs (AS-PCDs) - one triangle case

Description

Returns I(pt \in N_{AS}(x) for some x \in S), that is, returns 1 if p is in \cup_{x \in S}N_{AS}(x), returns 0 otherwise, where N_{AS}(x) is the AS proximity region for point x.

AS proximity regions are constructed with respect to the triangle, tri=T(A,B,C)=(rv=1,rv=2,rv=3), and vertices of tri are also labeled as 1,2, and 3, respectively.

Vertex regions are based on the center M="CC" for circumcenter of tri; or M=(m_1,m_2) in Cartesian coordinates or M=(\alpha,\beta,\gamma) in barycentric coordinates in the interior of the triangle tri; default is M="CC" i.e., circumcenter of tri.

If p is not in S and either p or all points in S are outside tri, it returns 0, but if p is in S, then it always returns 1 (i.e., loops are allowed).

See also (\insertCiteceyhan:Phd-thesis,ceyhan:comp-geo-2010,ceyhan:mcap2012;textualpcds).

Usage

IarcASset2pnt.tri(S, p, tri, M = "CC")

Arguments

S

A set of 2D points whose AS proximity regions are considered.

p

A 2D point. The function determines whether p is inside the union of AS proximity regions of points in S or not.

tri

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

M

The center of the triangle. "CC" stands for circumcenter of the triangle tri or a 2D point in Cartesian coordinates or a 3D point in barycentric coordinates which serves as a center in the interior of tri; default is M="CC" i.e., the circumcenter of tri.

Value

I(pt \in \cup_{x in S}N_{AS}(x,r)), that is, returns 1 if p is in S or inside N_{AS}(x) for at least one x in S, returns 0 otherwise, where AS proximity region is constructed in tri

Author(s)

Elvan Ceyhan

References

\insertAllCited

See Also

IarcAStri, IarcASset2pnt.tri, and IarcCSset2pnt.tri

Examples

## Not run: 
A<-c(1,1); B<-c(2,0); C<-c(1.5,2);
Tr<-rbind(A,B,C);
n<-10

set.seed(1)
Xp<-runif.tri(n,Tr)$gen.points

S<-rbind(Xp[1,],Xp[2,])  #try also S<-c(1.5,1)

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

IarcASset2pnt.tri(S,Xp[3,],Tr,M)

S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,])
IarcASset2pnt.tri(S,Xp[3,],Tr,M)

IarcASset2pnt.tri(S,Xp[6,],Tr,M)

S<-rbind(c(.1,.1),c(.3,.4),c(.5,.3))
IarcASset2pnt.tri(S,Xp[3,],Tr,M)

IarcASset2pnt.tri(c(.2,.5),Xp[2,],Tr,M)
IarcASset2pnt.tri(Xp,c(.2,.5),Tr,M)
IarcASset2pnt.tri(Xp,Xp[2,],Tr,M)
IarcASset2pnt.tri(c(.2,.5),c(.2,.5),Tr,M)
IarcASset2pnt.tri(Xp[5,],Xp[2,],Tr,M)

S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,],c(.2,.5))
IarcASset2pnt.tri(S,Xp[3,],Tr,M)

P<-c(.4,.2)
S<-Xp[c(1,3,4),]
IarcASset2pnt.tri(Xp,P,Tr,M)
IarcASset2pnt.tri(S,P,Tr,M)

IarcASset2pnt.tri(rbind(S,S),P,Tr,M)

## End(Not run)


elvanceyhan/pcds documentation built on June 29, 2023, 8:12 a.m.