#*****************************************************************************80 # ## linterp_test tests linterp. # # 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: # # John Burkardt # cat ( date ( ), "\n" ) cat ( "\n" ) cat ( "linterp_test\n" ) cat ( " ", version$version.string, "\n" ) cat ( " linterp computes the intercept and slope of the line through two points.\n" ) source ( "/home/burkardt/public_html/r_src/linterp/linterp.R" ) cat ( "\n" ) x1 = 2 y1 = 3 cat ( " (x1,y1) = (", x1, ",", y1, ")\n" ) x2 = 0 y2 = -1 cat ( " (x2,y2) = (", x2, ",", y2, ")\n" ) p <- linterp ( x1, y1, x2, y2 ) cat ( "\n" ) cat ( " p <- linterp ( x1, y1, x2, y2 )\n" ) cat ( "\n" ) print ( p ) b = p[1] m = p[2] cat ( "\n" ) cat ( " Line is y = ", m, " x + ", b, "\n" ) source ( "/home/burkardt/public_html/r_src/horner/horner.R" ) x3 = 1.0 y3 = horner ( x3, p ) cat ( " y3 <- horner ( x3, p )\n" ) cat ( " ", y3, " <- horner ( ", x3, ", p )\n" ); # # Terminate. # cat ( "\n" ) cat ( "linterp_test\n" ) cat ( " Normal end of execution.\n" ) cat ( date ( ), "\n" ) quit ( )