# \donttest{
A<-c(1.1,1.2); B<-c(2.3,3.4); p<-c(.51,2.5)
paraline(p,A,B,.45)
pts<-rbind(A,B,p)
xr<-range(pts[,1])
xf<-(xr[2]-xr[1])*.25
#how far to go at the lower and upper ends in the x-coordinate
x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100
plnAB<-paraline(p,A,B,x)
plnAB
summary(plnAB)
plot(plnAB)
y<-plnAB$y
Xlim<-range(x,pts[,1])
if (!is.na(y[1])) {Ylim<-range(y,pts[,2])} else {Ylim<-range(pts[,2])}
xd<-Xlim[2]-Xlim[1]
yd<-Ylim[2]-Ylim[1]
pf<-c(xd,-yd)*.025
plot(A,pch=".",xlab="",ylab="",main="Line Crossing P and Parallel to AB",
xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05))
points(pts)
txt.str<-c("A","B","p")
text(pts+rbind(pf,pf,pf),txt.str)
segments(A[1],A[2],B[1],B[2],lty=2)
if (!is.na(y[1])) {lines(x,y,type="l",lty=1,xlim=Xlim,ylim=Ylim)} else {abline(v=p[1])}
tx<-(A[1]+B[1])/2;
if (!is.na(y[1])) {ty<-paraline(p,A,B,tx)$y} else {ty=p[2]}
text(tx,ty,"line parallel to AB\n and crossing p")
# }
Run the code above in your browser using DataLab