Two functions, lA_CM.Te
and lB_CM.Te
of class "TriLines"
.
Returns the equation, slope, intercept
, and
lA_CM.Te
is the line joining
lB_CM.Te
is the line joining vector
x
.
lA_CM.Te(x)lB_CM.Te(x)
A single scalar or a vector
of scalars which is the argument of the functions
lA_CM.Te
and lB_CM.Te
.
A list
with the elements
Longer description of the line.
Shorter description of the line (to be inserted over the line in the plot).
The "main"
title for the plot of the line.
The center chosen inside the standard equilateral triangle.
The name of the center inside the standard equilateral triangle.
It is "CM"
for these two functions.
The triangle (it is the standard equilateral triangle for this function).
The input vector, can be a scalar or a vector
of scalars,
which constitute the
The output vector, will be a scalar if x
is a scalar or a vector
of scalars
if x
is a vector
of scalar, constitutes the
Slope of the line.
Intercept of the line.
Equation of the line.
# NOT RUN {
#Examples for lA_CM.Te
A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2);
Te<-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
lnACM<-lA_CM.Te(x)
lnACM
summary(lnACM)
plot(lnACM)
CM<-(A+B+C)/3;
D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2;
Ds<-rbind(D1,D2,D3)
Xlim<-range(Te[,1])
Ylim<-range(Te[,2])
xd<-Xlim[2]-Xlim[1]
yd<-Ylim[2]-Ylim[1]
plot(Te,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05))
polygon(Te)
L<-Te; R<-Ds
segments(L[,1], L[,2], R[,1], R[,2], lty=2)
txt<-rbind(Te,CM,D1,D2,D3,c(.25,lA_CM.Te(.25)$y),c(.75,lB_CM.Te(.75)$y))
xc<-txt[,1]+c(-.02,.02,.02,.05,.05,-.03,.0,0,0)
yc<-txt[,2]+c(.02,.02,.02,.02,0,.02,-.04,0,0)
txt.str<-c("A","B","C","CM","D1","D2","D3","lA_CM.Te(x)","lB_CM.Te(x)")
text(xc,yc,txt.str)
lA_CM.Te(.25)$y
#Examples for lB_CM.Te
A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2);
Te<-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
lnBCM<-lB_CM.Te(x)
lnBCM
summary(lnBCM)
plot(lnBCM,xlab="x",ylab="y")
lB_CM.Te(.25)$y
# }
Run the code above in your browser using DataLab