[−][src]Function rusty_fitpack::splder
pub fn splder(
t: &Vec<f64>,
c: &Vec<f64>,
k: usize,
x: &Vec<f64>,
nu: usize
) -> Vec<f64>
The function splder
evaluates a number of points $x(i)$ with $i=1,2,...,m$
the derivative of order nu of a spline $s(x)$ of degree $k$, given in its
B-spline representation.
Example
Simple example of spline interpolation and evaluation of the first derivative
use rusty_fitpack::{splrep, splder}; let x = vec![0.5, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]; let y = vec![0.0, 1.0, 4.0, 9.0, 16.0, 25.0, 36.0, 49.0, 64.0]; let (t, c, k) = splrep(x, y, None, None, None, None, None, None, None, None, None, None); // the points where we want to evaluate the spline let x_evaluate: Vec<f64> = vec![1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0]; let y_from_spline: Vec<f64> = splder(&t, &c, k, &x_evaluate, 1);
Arguments:
t
: position of the knots.
c
: b-spline coefficients.
k
: the degree of $s(x)$.
x
: points where $s(x)$ must be evaluated.
nu
: order of derivative
Output:
y
: the value of s(x) at the different points.
Restrictions:
$m >= 1$
$t(k+1) <= x(i) <= x(i+1) <= t(n-k)$ with $i = 1, 2,...,m-1$
$ 0 <= \nu <= k$
References
[1] De Boor, C. On calculating with B-splines, J. Approximation Theory, 6 (1972) 50-62.
[2] Cox, M.G., The numerical evaluation of B-splines, J. Inst. Maths Applics 10 (1972) 134-149.
[3] Dierckx, P. Curve and Surface fitting with splines, Monographs on Numerical Analysis, Oxford University Press, 1993.