An object of class "Extrema"
.
Returns the closest data points among the data set, Dt
, to face M
-vertex region
Vertex regions are based on center M
which can be the center
of mass ("CM"
) or circumcenter ("CC"
) of th
.
cl2fVRth(Dt, th, M = "CM")
A list
with the elements
Vertex labels are
A short description of the distances as "Distances from Closest Points to Faces ..."
.
Type of the extrema points
A short description of the extrema points
The "main"
title for the plot of the extrema
The extrema points, here, closest points to faces in the respective vertex region.
The input data, Dt
, can be a matrix
or data frame
The number of data points, i.e., size of Dt
Support of the data points, here, it is th
The center point used for construction of vertex regions, it is circumcenter of center of mass for this function
Name of the center, it is circumcenter "CC"
or center of mass "CM"
for this function.
Vertex regions inside the tetrahedron th
provided as a list.
Names of the vertex regions as "vr=1","vr=2","vr=3","vr=4"
Centers of mass of the vertex regions inside th
.
Distances from closest points in each vertex region to the corresponding face.
A set of 3D points representing the set of data points.
Four 3D points, stacked row-wise, each row representing a vertex of the tetrahedron.
The center to be used in the construction of the vertex regions in the tetrahedron, th
.
Currently it only takes "CC"
for circumcenter and "CM"
for center of mass; default="CM"
.
Elvan Ceyhan
fr2vVRCC
, fr2eTeER
, Kfr2vTbVRCC
and Kfr2vVRCC
# \donttest{
A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3)
tetra<-rbind(A,B,C,D)
Cent<-"CC" #try also "CM"
n<-10 #try also n<-20
Dt<-runif.tetra(n,tetra)$g #try also Dt<-cbind(runif(n),runif(n),runif(n))
Ext<-cl2fVRth(Dt,tetra,Cent)
Ext
summary(Ext)
plot(Ext)
cl2fVRth(c(.5,.5,.5),tetra,Cent)
cl2fVRth(Dt,tetra,Cent)
clf<-cl2fVRth(Dt,tetra,Cent)$ext
clf
if (Cent=="CC") {M<-circ.cent.tetra(tetra)}
if (Cent=="CM") {M<-apply(tetra,2,mean)}
Xlim<-range(tetra[,1],Dt[,1],M[1])
Ylim<-range(tetra[,2],Dt[,2],M[2])
Zlim<-range(tetra[,3],Dt[,3],M[3])
xd<-Xlim[2]-Xlim[1]
yd<-Ylim[2]-Ylim[1]
zd<-Zlim[2]-Zlim[1]
plot3D::scatter3D(Dt[,1],Dt[,2],Dt[,3], phi =0,theta=40, bty = "g",
xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05),
pch = 20, cex = 1, ticktype = "detailed")
#add the vertices of the tetrahedron
plot3D::points3D(tetra[,1],tetra[,2],tetra[,3], add=TRUE)
L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D)
plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2)
plot3D::points3D(clf[,1],clf[,2],clf[,3], pch=4,col="red", add=TRUE)
plot3D::text3D(tetra[,1],tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE)
#for center of mass use #Cent<-apply(tetra,2,mean)
D1<-(A+B)/2; D2<-(A+C)/2; D3<-(A+D)/2; D4<-(B+C)/2; D5<-(B+D)/2; D6<-(C+D)/2;
L<-rbind(D1,D2,D3,D4,D5,D6); R<-rbind(M,M,M,M,M,M)
plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lty=2)
cl2fVRth(Dt,tetra,Cent)
P<-c(.1,.1,.1)
cl2fVRth(P,tetra,Cent)
dat.fr<-data.frame(a=Dt)
cl2fVRth(dat.fr,tetra,Cent)
dat.fr<-data.frame(a=tetra)
cl2fVRth(Dt,dat.fr,Cent)
# }
Run the code above in your browser using DataLab