powered by
Constructs a cardinal cubic B-spline interpolator given data points.
cardinal_cubic_b_spline( y, t0, h, left_endpoint_derivative = NULL, right_endpoint_derivative = NULL )
An object of class cardinal_cubic_b_spline with methods:
cardinal_cubic_b_spline
interpolate(x): Evaluate the spline at point x.
interpolate(x)
x
prime(x): Evaluate the first derivative of the spline at point x.
prime(x)
double_prime(x): Evaluate the second derivative of the spline at point x.
double_prime(x)
Numeric vector of data points to interpolate.
Numeric scalar representing the starting point of the data.
Numeric scalar representing the spacing between data points.
Optional numeric scalar for the derivative at the left endpoint.
Optional numeric scalar for the derivative at the right endpoint.
y <- c(1, 2, 0, 2, 1) t0 <- 0 h <- 1 spline_obj <- cardinal_cubic_b_spline(y, t0, h) x <- 0.5 spline_obj$interpolate(x) spline_obj$prime(x) spline_obj$double_prime(x)
Run the code above in your browser using DataLab