beziervalue.m

来自「自己编写的matlab gui可以实现贝塞尔曲线的参数选择和拟合效果」· M 代码 · 共 14 行

M
14
字号
%Bezier general function
%plot in 51 points
function value=Beziervalue(P,u)
                            %number of plotting points
pointsize=size(P);          %get the points decides the number of bases 4=5-1 and dimension;
len=pointsize(1);        %the group of control points 5
dimension=pointsize(2);     %the dimension of points 2D or 3D

n=len-1;
value=zeros(1,dimension);

for k=0:n           %the number of bases
    value=value+P(k+1,:).*nchoosek(n,k).*(u^k).*((1-u)^(n-k));
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?