TP-traitement-audio-visuel/TP2/bezier.m

8 lines
163 B
Mathematica
Raw Normal View History

2023-06-22 18:47:16 +00:00
function y = bezier(beta_0,beta,beta_d,x)
d = length(beta)+1;
y = beta_0*(1-x).^d+beta_d*x.^d;
for i = 1:d-1
y = y+beta(i)*nchoosek(d,i)*x.^i.*(1-x).^(d-i);
end