funsTbMid2CC {pcds} | R Documentation |
Two functions lineD1CCinTb
and lineD2CCinTb
which are of class "TriLines"
—
The lines joining the midpoints of edges to the circumcenter (
) in the standard basic triangle.
Description
Returns the equation, slope, intercept
, and -coordinates of the lines
joining
and
and also
and
, in the standard basic triangle
where
is in
,
and
and
and
are the midpoints of edges
and
.
Any given triangle can be mapped to the standard basic triangle by a combination of rigid body motions
(i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the
original triangle. Hence standard basic triangle is useful for simulation
studies under the uniformity hypothesis.
-coordinates are provided in
vector
x
.
Usage
lineD1CCinTb(x, c1, c2)
lineD2CCinTb(x, c1, c2)
Arguments
x |
A single scalar or a |
c1 , c2 |
Positive real numbers which constitute the vertex of the standard basic triangle
adjacent to the shorter edges; |
Value
A list
with the elements
txt1 |
Longer description of the line. |
txt2 |
Shorter description of the line (to be inserted over the line in the plot). |
mtitle |
The |
cent |
The center chosen inside the standard equilateral triangle. |
cent.name |
The name of the center inside the standard basic triangle.
It is |
tri |
The triangle (it is the standard basic triangle for this function). |
x |
The input vector, can be a scalar or a |
y |
The output vector, will be a scalar if |
slope |
Slope of the line. |
intercept |
Intercept of the line. |
equation |
Equation of the line. |
Author(s)
Elvan Ceyhan
See Also
lineA2CMinTe
, lineB2CMinTe
, lineA2MinTe
,
lineB2MinTe
, and lineC2MinTe
Examples
#Examples for lineD1CCinTb
c1<-.4; c2<-.6;
A<-c(0,0); B<-c(1,0); C<-c(c1,c2); #the vertices of the standard basic triangle Tb
Tb<-rbind(A,B,C)
xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate
x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,by=.1) #try also by=.01
lnD1CC<-lineD1CCinTb(x,c1,c2)
lnD1CC
summary(lnD1CC)
plot(lnD1CC)
CC<-circumcenter.basic.tri(c1,c2) #the circumcenter
CC
D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; #midpoints of the edges
Ds<-rbind(D1,D2,D3)
x1<-seq(0,1,by=.1) #try also by=.01
y1<-lineD1CCinTb(x1,c1,c2)$y
Xlim<-range(Tb[,1],x1)
Ylim<-range(Tb[,2],y1)
xd<-Xlim[2]-Xlim[1]
yd<-Ylim[2]-Ylim[1]
plot(A,pch=".",asp=1,xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05))
polygon(Tb)
L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds
segments(L[,1], L[,2], R[,1], R[,2], lty=2)
txt<-rbind(Tb,CC,D1,D2,D3)
xc<-txt[,1]+c(-.03,.04,.03,.02,.09,-.08,0)
yc<-txt[,2]+c(.02,.02,.04,.08,.03,.03,-.05)
txt.str<-c("A","B","C","CC","D1","D2","D3")
text(xc,yc,txt.str)
lines(x1,y1,type="l",lty=2)
text(.8,.5,"lineD1CCinTb")
c1<-.4; c2<-.6;
x1<-seq(0,1,by=.1) #try also by=.01
lineD1CCinTb(x1,c1,c2)
#Examples for lineD2CCinTb
c1<-.4; c2<-.6;
A<-c(0,0); B<-c(1,0); C<-c(c1,c2); #the vertices of the standard basic triangle Tb
Tb<-rbind(A,B,C)
xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate
x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,by=.1) #try also by=.01
lnD2CC<-lineD2CCinTb(x,c1,c2)
lnD2CC
summary(lnD2CC)
plot(lnD2CC)
CC<-circumcenter.basic.tri(c1,c2) #the circumcenter
CC
D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; #midpoints of the edges
Ds<-rbind(D1,D2,D3)
x2<-seq(0,1,by=.1) #try also by=.01
y2<-lineD2CCinTb(x2,c1,c2)$y
Xlim<-range(Tb[,1],x1)
Ylim<-range(Tb[,2],y2)
xd<-Xlim[2]-Xlim[1]
yd<-Ylim[2]-Ylim[1]
plot(A,pch=".",asp=1,xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05))
polygon(Tb)
L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds
segments(L[,1], L[,2], R[,1], R[,2], lty=2)
txt<-rbind(Tb,CC,D1,D2,D3)
xc<-txt[,1]+c(-.03,.04,.03,.02,.09,-.08,0)
yc<-txt[,2]+c(.02,.02,.04,.08,.03,.03,-.05)
txt.str<-c("A","B","C","CC","D1","D2","D3")
text(xc,yc,txt.str)
lines(x2,y2,type="l",lty=2)
text(0,.5,"lineD2CCinTb")