powered by
Constructs a PCHIP interpolator given the vectors of abscissas, ordinates, and derivatives.
pchip(x, y, left_endpoint_derivative = NULL, right_endpoint_derivative = NULL)
An object of class pchip with methods:
pchip
interpolate(xi): Evaluate the interpolator at point xi.
interpolate(xi)
xi
prime(xi): Evaluate the derivative of the interpolator at point xi.
prime(xi)
push_back(x, y): Add a new control point
push_back(x, y)
Numeric vector of abscissas (x-coordinates).
Numeric vector of ordinates (y-coordinates).
Optional numeric value of the derivative at the left endpoint.
Optional numeric value of the derivative at the right endpoint.
x <- c(0, 1, 2, 3) y <- c(0, 1, 0, 1) interpolator <- pchip(x, y) xi <- 0.5 interpolator$interpolate(xi) interpolator$prime(xi) interpolator$push_back(4, 1)
Run the code above in your browser using DataLab