X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=CreaPhase.git;a=blobdiff_plain;f=octave_packages%2Fnurbs-1.3.6%2Fprivate%2Fnrb_crv_basisfun_der__.m;fp=octave_packages%2Fnurbs-1.3.6%2Fprivate%2Fnrb_crv_basisfun_der__.m;h=8857dc25c2f56b0bac57bab43c54154c92c0d83b;hp=0000000000000000000000000000000000000000;hb=f5f7a74bd8a4900f0b797da6783be80e11a68d86;hpb=1705066eceaaea976f010f669ce8e972f3734b05 diff --git a/octave_packages/nurbs-1.3.6/private/nrb_crv_basisfun_der__.m b/octave_packages/nurbs-1.3.6/private/nrb_crv_basisfun_der__.m new file mode 100644 index 0000000..8857dc2 --- /dev/null +++ b/octave_packages/nurbs-1.3.6/private/nrb_crv_basisfun_der__.m @@ -0,0 +1,32 @@ + function [Bu, nbfu] = nrb_crv_basisfun_der__ (points, nrb); +% __NRB_CRV_BASISFUN_DER__: Undocumented internal function +% +% Copyright (C) 2009 Carlo de Falco +% This software comes with ABSOLUTELY NO WARRANTY; see the file +% COPYING for details. This is free software, and you are welcome +% to distribute it under the conditions laid out in COPYING. + n = size (nrb.coefs, 2) -1; + p = nrb.order -1; + u = points; + U = nrb.knots; + w = nrb.coefs(4,:); + + spu = findspan (n, p, u, U); + nbfu = numbasisfun (spu, u, p, U); + + N = basisfun (spu, u, p, U); + + Nprime = basisfunder (spu, p, u, U, 1); + Nprime = squeeze(Nprime(:,2,:)); + + + [Dpc, Dpk] = bspderiv (p, w, U); + D = bspeval (p, w, U, u); + Dprime = bspeval (p-1, Dpc, Dpk, u); + + + Bu1 = bsxfun (@(np, d) np/d , Nprime.', D); + Bu2 = bsxfun (@(n, dp) n*dp, N.', Dprime./D.^2); + Bu = w(nbfu+1) .* (Bu1 - Bu2).'; + + end