Learn R Programming

pcds (version 0.1.6)

NumArcsAStri: Number of arcs of Arc Slice Proximity Catch Digraphs (AS-PCDs) - one triangle case

Description

Returns the number of arcs of Arc Slice Proximity Catch Digraphs (AS-PCDs) whose vertices are the 2D data set, Xp. It also provides number of vertices (i.e., number of data points inside the triangle) and indices of the data points that reside in the triangle.

The data points could be inside or outside a general triangle tri\(=T(A,B,C)=\)(rv=1,rv=2,rv=3), with vertices of tri stacked row-wise.

AS proximity regions are defined with respect to the triangle tri and 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. For the number of arcs, loops are not allowed, so arcs are only possible for points inside the triangle, tri.

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

Usage

NumArcsAStri(Xp, tri, M = "CC")

Value

A list with the elements

num.arcs

Number of arcs of the AS-PCD

num.in.tri

Number of Xp points in the triangle, tri

ind.in.tri

The vector of indices of the Xp points that reside in the triangle

Arguments

Xp

A set of 2D points which constitute the vertices of the digraph (i.e., AS-PCD).

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.

Author

Elvan Ceyhan

References

See Also

NumArcsAS, NumArcsPEtri, and NumArcsCStri

Examples

Run this code
if (FALSE) {
A<-c(1,1); B<-c(2,0); C<-c(1.5,2);
Tr<-rbind(A,B,C);

n<-10  #try also n<-20
set.seed(1)
Xp<-runif.tri(n,Tr)$g

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

NumArcsAStri(Xp,Tr,M)

Xp2=Xp+1
NumArcsAStri(Xp2,Tr,M)

NumArcsAStri(rbind(Xp,c(0,2)),Tr,M)
}

Run the code above in your browser using DataLab