View source: R/interpolators.R
| cardinal_cubic_hermite | R Documentation |
Constructs a cardinal cubic Hermite interpolator given the vectors of abscissas, ordinates, and derivatives.
cardinal_cubic_hermite(y, dydx, x0, dx)
y |
Numeric vector of ordinates (y-coordinates). |
dydx |
Numeric vector of derivatives (slopes) at each point. |
x0 |
Numeric value of the first abscissa (x-coordinate). |
dx |
Numeric value of the spacing between abscissas. |
An object of class cardinal_cubic_hermite with methods:
interpolate(xi): Evaluate the interpolator at point xi.
prime(xi): Evaluate the derivative of the interpolator at point xi.
domain(): Get the domain of the interpolator.
y <- c(0, 1, 0)
dydx <- c(1, 0, -1)
interpolator <- cardinal_cubic_hermite(y, dydx, 0, 1)
xi <- 0.5
interpolator$interpolate(xi)
interpolator$prime(xi)
interpolator$domain()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.