home *** CD-ROM | disk | FTP | other *** search
- function [v,b] = sprpp(tx,a)
- % SPRPP Convert locally from B-form to pp-form.
- %
- % [v,b] = sprpp(tx,a)
- %
- % uses knot insertion to derive from the B-spline coefficients
- % a(.,:) relevant for the interval [tx(.,k-1), tx(.,k)] (with respect
- % to the knot sequence tx(.,1:2(k-1)) ) the polynomial coefficients
- % v(.,1:k) relevant for the interval [0,tx(.,k)] . Here,
- %
- % [ ,k] := size(a) . Also, it is assumed that tx(.,k-1) <= 0 < tx(.,k) .
- %
- % In the process, uses repeated insertion of 0 to derive, in b(.,1:k) ,
- % the B-spline coefficients relevant for the interval [0,tx(.,k)] (with
- % respect to the knot sequence [0,...,0,tx(.,k:2*(k-1))]) .
-
- % C. de Boor / latest change: Feb.25, 1989
- % Copyright (c) 1990-92 by Carl de Boor and The MathWorks, Inc.
-
-
- [junk,k]=size(a); km1=k-1;b=a;
- for r=1:km1;
- for i=1:k-r;
- b(:,i) =(tx(:,i+km1).*b(:,i)-tx(:,i+r-1).*b(:,i+1))./...
- (tx(:,i+km1)-tx(:,i+r-1));
- end
- end
-
- % Use differentiation at 0 to generate the derivatives
-
- v=b;
- for r=2:k;
- factor = (k-r+1)/(r-1);
- for i=k:-1:r;
- v(:,i) = (v(:,i) - v(:,i-1))*factor./tx(:,i+k-r);
- end
- end
-
- v = v(:,k:-1:1);
-