New answers tagged splines
1
When manipulating B-splines in this manner, it is often convenient to fall back on the definitions. Luckily, since Mathematica supplies the function BSplineBasis[], using the definitions are easy:
pts = {{0, 0}, {1, 1}, {2, -1}, {3, 0}, {4, -2}, {5, 1}};
n = 3; (* B-spline degree *)
m = Length[pts];
(* clamped uniform knots for B-spline *)
knots = ...
3
One approach is to turn your expression into functions. I give a few extra variations just to show what can be done and which you might find useful to learn.
Here's the whole thing as a function (to be used, for example, in your Plot3D):
Bfn = Evaluate[B /. {x -> #1, y -> #2}] &;
Bfn[x, y] == B
(* True *)
Component functions can be ...
3
You can perform a replace:
B[[2,3]]/.{x->-1,y->0}
If you have a table of x and y values (call it xyvals) for given matrix elements then you could do:
Table[B[[m,n]]/.{x->xyvals[[m,n,1]],y->xyvals[[m,n,2]]},{m,Length[B]},{n,Length[B[[1]]]}]
Top 50 recent answers are included