[][src]Function rusty_fitpack::splder_uniform

pub fn splder_uniform(
    t: &Vec<f64>,
    c: &Vec<f64>,
    k: usize,
    x: f64,
    nu: usize
) -> f64

The function splder_uniform evaluates in a point x the derivative of order nu of a spline $s(x)$ of degree $k$, given in its 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_uniform};
let x = vec![0.0, 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 mut y_from_spline: Vec<f64> = Vec::new();
for value in x_evaluate.iter() {
    y_from_spline.push(splder_uniform(&t, &c, k, *value, 1));
}

Arguments:

t : position of the knots.
c : b-spline coefficients.
k : the degree of $s(x)$.
x : point 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$