figure; 
t = 0:0.001:1;

%%
h = drawpolyline;
hold on;
hcurve = plot(bezier(h.Position, t), 'g', 'linewidth', 2);
h.addlistener('MovingROI', @(h, evt) bezier(evt.CurrentPosition, t, hcurve));

%%
function p = bezier(p, t, h)

end

