powered by
It gives the value of the linear function defined from two points (x1,y1) and (x2,y2) at any x
lin2(x1, y1, x2, y2, x)
the x - abscissa of the first point
the y - ordinate of the first point
the x - abscissa of the second point
the y - ordinate of the second point
the x - point where we compute the value of the linear function
It returns the value of the linear function from (x1,y1) to (x2,y2) at an arbitrary x.
# NOT RUN { x1<-1 y1<-3 x2<-5 y2<-7 x<-10 ylin<-lin2(x1,y1,x2,y2,x) print(ylin) # }
Run the code above in your browser using DataLab