Learn R Programming

pcds (version 0.1.8)

NCStri: The vertices of the Central Similarity (CS) Proximity Region in a general triangle

Description

Returns the vertices of the CS proximity region (which is itself a triangle) for a point in the triangle tri\(=T(A,B,C)=\)(rv=1,rv=2,rv=3).

CS proximity region is defined with respect to the triangle tri with expansion parameter \(t>0\) and edge regions based on center \(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=(1,1,1)\) i.e., the center of mass of tri.

Edge regions are labeled as 1,2,3 rowwise for the corresponding vertices of the triangle tri. re is the index of the edge region p resides, with default=NULL. If p is outside of tri, it returns NULL for the proximity region.

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

Usage

NCStri(p, tri, t, M = c(1, 1, 1), re = NULL)

Value

Vertices of the triangular region which constitutes the CS proximity region with expansion parameter \(t>0\) and center M for a point p

Arguments

p

A 2D point whose CS proximity region is to be computed.

tri

A \(3 \times 2\) matrix with each row representing a vertex of the triangle.

t

A positive real number which serves as the expansion parameter in CS proximity region.

M

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

re

Index of the M-edge region containing the point p, either 1,2,3 or NULL (default is NULL).

Author

Elvan Ceyhan

References

See Also

NPEtri, NAStri, and IarcCStri

Examples

Run this code
# \donttest{
A<-c(1,1); B<-c(2,0); C<-c(1.5,2);
Tr<-rbind(A,B,C);
tau<-1.5

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

n<-3
set.seed(1)
Xp<-runif.tri(n,Tr)$g

NCStri(Xp[1,],Tr,tau,M)

P1<-as.numeric(runif.tri(1,Tr)$g)  #try also P1<-c(.4,.2)
NCStri(P1,Tr,tau,M)

#or try
re<-rel.edges.tri(P1,Tr,M)$re
NCStri(P1,Tr,tau,M,re)
# }

Run the code above in your browser using DataLab