View source: R/ArcSliceFunctions.R
IarcAStri | R Documentation |
Returns I(p2 \in N_{AS}(p1))
for points p1
and p2
,
that is, returns 1 if p2
is in N_{AS}(p1)
, 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 vertex 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 the triangle tri
or based on circumcenter of tri
;
default is M="CC"
, i.e., circumcenter of tri
.
rv
is the index of the vertex region p1
resides,
with default=NULL
.
If p1
and p2
are distinct
and either of them are outside tri
, the function returns 0,
but if they are identical,
then it returns 1 regardless of their locations (i.e., it allows loops).
See also (\insertCiteceyhan:Phd-thesis,ceyhan:comp-geo-2010,ceyhan:mcap2012;textualpcds).
IarcAStri(p1, p2, tri, M = "CC", rv = NULL)
p1 |
A 2D point whose AS proximity region is constructed. |
p2 |
A 2D point. The function determines whether |
tri |
Three 2D points, stacked row-wise, each row representing a vertex of the triangle. |
M |
The center of the triangle.
|
rv |
The index of the |
I(p2 \in N_{AS}(p1))
for p1
, that is,
returns 1 if p2
is in N_{AS}(p1)
, returns 0 otherwise
Elvan Ceyhan
IarcASbasic.tri
, IarcPEtri
, and IarcCStri
A<-c(1,1); B<-c(2,0); C<-c(1.5,2);
Tr<-rbind(A,B,C);
M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2)
P1<-as.numeric(runif.tri(1,Tr)$g)
P2<-as.numeric(runif.tri(1,Tr)$g)
IarcAStri(P1,P2,Tr,M)
P1<-c(1.3,1.2)
P2<-c(1.8,.5)
IarcAStri(P1,P2,Tr,M)
IarcAStri(P1,P1,Tr,M)
#or try
Rv<-rel.vert.triCC(P1,Tr)$rv
IarcAStri(P1,P2,Tr,M,Rv)
P3<-c(1.6,1.4)
IarcAStri(P1,P3,Tr,M)
P4<-c(1.5,1.0)
IarcAStri(P1,P4,Tr,M)
P5<-c(.5,1.0)
IarcAStri(P1,P5,Tr,M)
IarcAStri(P5,P5,Tr,M)
#or try
Rv<-rel.vert.triCC(P5,Tr)$rv
IarcAStri(P5,P5,Tr,M,Rv)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.