R/interp.R

Defines functions interp.h3

# cubic hermite polynomial interpolation
interp.h3 <- function( x, x0, x1, y0, y1, yp0, yp1 ) {
    delx <- x1 - x0
    s    <- ( x - x0 )/delx
    s2   <- s*s
    s3   <- s*s2
    dydx <- ( y1 - y0 )/delx
    
    c    <- 3*dydx - 2*yp0 - yp1
    d    <- yp0 + yp1 - 2*dydx
    
    y    <- y0  + (delx*d*s3 + delx*c*s2 + delx*yp0*s)
    #yp   <- yp0 + (3*d*s2 + 2*c*s) 
    
    y
}

Try the RMTstat package in your browser

Any scripts or data that you put into this service are public.

RMTstat documentation built on April 13, 2022, 1:07 a.m.