1 function Nip = onebasisfun__ (u, p, U)
3 % __ONEBASISFUN__: Undocumented internal function
5 % Adapted from Algorithm A2.4 from 'The NURBS BOOK' pg74.
7 % Copyright (C) 2009 Carlo de Falco
8 % Copyright (C) 2012 Rafael Vazquez
9 % This software comes with ABSOLUTELY NO WARRANTY; see the file
10 % COPYING for details. This is free software, and you are welcome
11 % to distribute it under the conditions laid out in COPYING.
13 Nip = zeros (size (u));
17 if ((u(ii) == U(1)) && (U(1) == U(end-1)) || ...
18 (u(ii) == U(end)) && (U(end) == U(2)))
22 if (~ any (U <= u(ii))) || (~ any (U > u(ii)))
25 for jj = 1:p+1 % Initialize zero-th degree functions
26 if (u(ii) > U(jj) && u(ii) < U(jj+1))
36 saved = (u(ii) - U(1))*N(1) / (U(k+1)-U(1));
46 temp = N(jj+1)/(Uright-Uleft);
47 N(jj) = saved + (Uright - u(ii))*temp;
48 saved = (u(ii) - Uleft)*temp;