linterp <- function ( x1, y1, x2, y2 ) #*****************************************************************************80 # ## linterp computes the intercept and slope of a line. # # Licensing: # # Copyright 2016 James P. Howard, II # # The computer code and data files on this web page are distributed under # https://opensource.org/licenses/BSD-2-Clause, the BSD-2-Clause license. # # Modified: # # 20 February 2020 # # Author: # # Original R code by James Howard; # Modifications by John Burkardt. # # Reference: # # James Howard, # Computational Methods for Numerical Analysis with R, # CRC Press, 2017, # ISBN13: 978-1-4987-2363-3. # { m <- ( y2 - y1 ) / ( x2 - x1 ) b <- y2 - m * x2 return ( c ( b, m ) ) }