www.gusucode.com > symbolic 源码程序 matlab案例代码 > symbolic/BernsteinMatrix3Example.m

    %% 3-D Bezier Curve with the Evaluation Point Specified as a Vector
%% 1 

% Copyright 2015 The MathWorks, Inc.

t = 0:1/100:1;
B = bernsteinMatrix(3,t);
P = [0 0 0; 2 2 2; 2 -1 1; 6 1 3];
%% 2
bezierCurve = B*P;
plot3(bezierCurve(:,1), bezierCurve(:,2), bezierCurve(:,3))
hold on
grid
scatter3(P(:,1), P(:,2), P(:,3),'filled')
hold off