TBASISFUN: Compute a B- or T-Spline basis function, and its derivatives, from its local knot vector.

 usage:

 [N, Nder] = tbasisfun (u, p, U)
 [N, Nder] = tbasisfun ([u; v], [p q], {U, V})
 [N, Nder] = tbasisfun ([u; v; w], [p q r], {U, V, W})
 
 INPUT:
  u or [u; v] : points in parameter space where the basis function is to be
  evaluated 
  
  U or {U, V} : local knot vector

  p or [p q] : polynomial order of the basis function

 OUTPUT:
  N : basis function evaluated at the given parametric points
  Nder : gradient of the basis function evaluated at the given points

Demonstration 1

The following code

 U = {[0 0 1/2 1 1], [0 0 0 1 1]};
 p = [3, 3];
 [X, Y] = meshgrid (linspace(0, 1, 30));
 u = [X(:), Y(:)]';
 N = tbasisfun (u, p, U);
 surf (X, Y, reshape (N, size(X)))
 title('Basis function associated to a local knot vector')
 hold off

Produces the following figure

Figure 1

Package: nurbs