TP-traitement-audio-visuel/TP2/bezier.m
2023-06-22 20:47:16 +02:00

8 lines
163 B
Mathematica

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