fr2edgesCMedge.reg.std.tri: The furthest points in a data set from edges in each CM-edge...

View source: R/AuxExtrema.R

fr2edgesCMedge.reg.std.triR Documentation

The furthest points in a data set from edges in each CM-edge region in the standard equilateral triangle

Description

An object of class "Extrema". Returns the furthest data points among the data set, Xp, in each CM-edge region from the edge in the standard equilateral triangle T_e=T(A=(0,0),B=(1,0),C=(1/2,\sqrt{3}/2)).

ch.all.intri is for checking whether all data points are inside T_e (default is FALSE).

See also (\insertCiteceyhan:Phd-thesis;textualpcds).

Usage

fr2edgesCMedge.reg.std.tri(Xp, ch.all.intri = FALSE)

Arguments

Xp

A set of 2D points, some could be inside and some could be outside standard equilateral triangle T_e.

ch.all.intri

A logical argument used for checking whether all data points are inside T_e (default is FALSE).

Value

A list with the elements

txt1

Edge labels as AB=3, BC=1, and AC=2 for T_e (correspond to row number in Extremum Points).

txt2

A short description of the distances as "Distances to Edges".

type

Type of the extrema points

desc

A short description of the extrema points

mtitle

The "main" title for the plot of the extrema

ext

The extrema points, here, furthest points from edges in each edge region.

X

The input data, Xp, can be a matrix or data frame

num.points

The number of data points, i.e., size of Xp

supp

Support of the data points, here, it is T_e.

cent

The center point used for construction of edge regions.

ncent

Name of the center, cent, it is center of mass "CM" for this function.

regions

Edge regions inside the triangle, T_e, provided as a list.

region.names

Names of the edge regions as "er=1", "er=2", and "er=3".

region.centers

Centers of mass of the edge regions inside T_e.

dist2ref

Distances from furthest points in each edge region to the corresponding edge.

Author(s)

Elvan Ceyhan

References

\insertAllCited

See Also

fr2vertsCCvert.reg.basic.tri, fr2vertsCCvert.reg, fr2vertsCCvert.reg.basic.tri, kfr2vertsCCvert.reg, and cl2edges.std.tri

Examples

## Not run: 
n<-20
Xp<-runif.std.tri(n)$gen.points

Ext<-fr2edgesCMedge.reg.std.tri(Xp)
Ext
summary(Ext)
plot(Ext,asp=1)

ed.far<-Ext

Xp2<-rbind(Xp,c(.8,.8))
fr2edgesCMedge.reg.std.tri(Xp2)
fr2edgesCMedge.reg.std.tri(Xp2,ch.all.intri = FALSE)
#gives error if ch.all.intri = TRUE

A<-c(0,0); B<-c(1,0); C<-c(0.5,sqrt(3)/2);
Te<-rbind(A,B,C)
CM<-(A+B+C)/3
p1<-(A+B)/2
p2<-(B+C)/2
p3<-(A+C)/2

Xlim<-range(Te[,1],Xp[,1])
Ylim<-range(Te[,2],Xp[,2])
xd<-Xlim[2]-Xlim[1]
yd<-Ylim[2]-Ylim[1]

plot(A,pch=".",xlab="",ylab="",
main="Furthest Points in CM-Edge Regions \n of Std Equilateral Triangle from its Edges",
axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05))
polygon(Te)
L<-Te; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE)
segments(L[,1], L[,2], R[,1], R[,2], lty=2)
points(Xp,xlab="",ylab="")
points(ed.far$ext,pty=2,pch=4,col="red")

txt<-rbind(Te,CM,p1,p2,p3)
xc<-txt[,1]+c(-.03,.03,.03,-.06,0,0,0)
yc<-txt[,2]+c(.02,.02,.02,.02,0,0,0)
txt.str<-c("A","B","C","CM","re=2","re=3","re=1")
text(xc,yc,txt.str)

## End(Not run)


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