User is supposed to enter N number of control points, by which first Bezier curve is plot. After this, the user again enters P number of control points, and then using the last point of the first curve and the recently entered control points, another Bezier curve is blended with it, which has to be continuous with the first curve. I am using the following to plot curves, but unable to check for continuity. Please help.
N=input('enter the number of control points ');
for (i=1:N)
P(i,:)=input('enter the coordinates of point [x y]' );
end
K=input('enter the number of points to plot ');
syms u
Px=0;
Py=0;
for(i=1:N)
b=(factorial(N-1)/factorial(N-1-i+1)/factorial(i-1))*(u^(i-1))*(1-u)^(N-1-i+1);
Px= Px+ b*P(i,1);
Py= Py+ b*P(i,2);
end
for(i=1:K+1)
Rx(i)=subs(Px,u,(i-1)/K);
Ry(i)=subs(Py,u,(i-1)/K);
end
plot(Rx,Ry)
axis equal