View source: R/interpolators.R
| catmull_rom | R Documentation |
Constructs a Catmull-Rom spline interpolator given control points.
catmull_rom(control_points, closed = FALSE, alpha = 0.5)
control_points |
List of control points, where each element is a numeric vector of length 3. |
closed |
Logical indicating whether the spline is closed (i.e., the first and last control points are connected), defaults to false |
alpha |
Numeric scalar for the tension parameter, defaults to 0.5 |
An object of class catmull_rom with methods:
interpolate(xi): Evaluate the interpolator at point xi.
prime(xi): Evaluate the derivative of the interpolator at point xi.
max_parameter(): Get the maximum parameter value of the spline.
parameter_at_point(i): Get the parameter value at index i.
control_points <- list(c(0, 0, 0), c(1, 1, 0), c(2, 0, 0), c(3, 1, 0))
interpolator <- catmull_rom(control_points)
xi <- 1.5
interpolator$interpolate(xi)
interpolator$prime(xi)
interpolator$max_parameter()
interpolator$parameter_at_point(2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.