Returns p1
and p2
, that is, returns 1 if
AS proximity regions are constructed with respect to the triangle, tri
(rv=1,rv=2,rv=3)
,
and vertex regions are based on the center M="CC"
for circumcenter of tri
;
or 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 (ceyhan:Phd-thesis,ceyhan:comp-geo-2010,ceyhan:mcap2012;textualpcds).
IndNAStri(p1, p2, tri, M = "CC", rv = NULL)
p1
, that is, returns 1 if
A 2D point whose AS proximity region is constructed.
A 2D point. The function determines whether p2
is inside the AS proximity region of
p1
or not.
Three 2D points, stacked row-wise, each row representing a vertex of the triangle.
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
.
The index of the M
-vertex region in tri
containing the point, either 1,2,3
or NULL
(default is NULL
).
Elvan Ceyhan
IndNASbas.tri
, IndNPEtri
, and IndNCStri
if (FALSE) {
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)
IndNAStri(P1,P2,Tr,M)
P1<-c(1.3,1.2)
P2<-c(1.8,.5)
IndNAStri(P1,P2,Tr,M)
IndNAStri(P1,P1,Tr,M)
#or try
Rv<-rv.triCC(P1,Tr)$rv
IndNAStri(P1,P2,Tr,M,Rv)
P3<-c(1.6,1.4)
IndNAStri(P1,P3,Tr,M)
P4<-c(1.5,1.0)
IndNAStri(P1,P4,Tr,M)
P5<-c(.5,1.0)
IndNAStri(P1,P5,Tr,M)
IndNAStri(P5,P5,Tr,M)
#or try
Rv<-rv.triCC(P5,Tr)$rv
IndNAStri(P5,P5,Tr,M,Rv)
}
Run the code above in your browser using DataLab