You are on page 1of 1

r2=6;

r3=13;
r4=10;
r1=15;
N=60;
tetha2=(0:2*pi/N:2*pi)

syms t3 t4
t=[30*pi/180;80*pi/180];
for i=1:N+1

fn=[r2*cos(tetha2(i))+r3*cos(t3)-15-r4*cos(t4) ;r2*sin(tetha2(i))+r3*sin(t3)-
r4*sin(t4)];
fp=jacobian(fn);
tol=0.02

f=inline(fn);
jf=inline(fp);

err=norm(f(t(1),t(2)),2);
while err>=tol
ft=f(t(1),t(2));
fpt=jf(t(1),t(2));
tn=t-(inv(fpt)*ft);
err=norm(f(tn(1),tn(2)),2);
t=tn;
end

tetha3(i)=t(1);
tetha4(i)=t(2);

end

figure(1)
plot(tetha2, tetha3, tetha2, tetha4)

You might also like