L1 = 3;
L2 = 3*sqrt(2);
L3 = 3;
gamma = pi/4;

zero1=bisection(@f2,1.5,2.5,eps);
zero2=bisection(@f2,-0.6,-0.8,eps);
zero3=bisection(@f2,-0.4,-0.2,eps);
zero4=bisection(@f2,1,1.4,eps);

xy1=f22(zero1);
x11=xy1(1);
y11=xy1(2);

xy2=f22(zero2);
x22=xy2(1);
y22=xy2(2);

xy3=f22(zero3);
x33=xy3(1);
y33=xy3(2);

xy4=f22(zero4);
x44=xy4(1); 
y44=xy4(2);

u1=[x11+L2*cos(zero1+gamma) x11+L3*cos(zero1)];
v1=[y11+L2*sin(zero1+gamma) y11+L3*sin(zero1)];

u2=[x22+L2*cos(zero2+gamma) x22+L3*cos(zero2)];
v2=[y22+L2*sin(zero2+gamma) y22+L3*sin(zero2)];

u3=[x33+L2*cos(zero3+gamma) x33+L3*cos(zero3)];
v3=[y33+L2*sin(zero3+gamma) y33+L3*sin(zero3)];

u4=[x44+L2*cos(zero4+gamma) x44+L3*cos(zero4)];
v4=[y44+L2*sin(zero4+gamma) y44+L3*sin(zero4)];

figure
plot([x11 u1 x11],[y11 v1 y11],'r'); hold on
plot([0 5 0], [0 0 6], 'bo');
plot([0 x11], [0 y11], 'g', [u1(2) 5], [v1(2) 0], 'g', [0 u1(1)], [6 v1(1)], 'g')
title('figure 1 part 4')

figure
plot([x22 u2 x22],[y22 v2 y22],'r'); hold on
plot([0 5 0], [0 0 6], 'bo');
plot([0 x22], [0 y22], 'g', [u2(2) 5], [v2(2) 0], 'g', [0 u2(1)], [6 v2(1)], 'g')
title('figure 2 part 4')

figure
plot([x33 u3 x33],[y33 v3 y33],'r'); hold on
plot([0 5 0], [0 0 6], 'bo');
plot([0 x33], [0 y33], 'g', [u3(2) 5], [v3(2) 0], 'g', [0 u3(1)], [6 v3(1)], 'g')
title('figure 3 part 4')

figure
plot([x44 u4 x44],[y44 v4 y44],'r'); hold on
plot([0 5 0], [0 0 6], 'bo');
plot([0 x44], [0 y44], 'g', [u4(2) 5], [v4(2) 0], 'g', [0 u4(1)], [6 v4(1)], 'g')
title('figure 4 part 4')
