theta = -pi:0.01:pi;
y = f(theta);
plot(theta, y)
grid on
theta = P1Bisect(5,0,6,3,3*sqrt(2),3,pi/4,5,6.99,3,-0.8,-0.6,10^(-10));
theta

theta =

   -0.6969

theta = P1Bisect(5,0,6,3,3*sqrt(2),3,pi/4,5,6.99,3,-0.4,-0.3,10^(-10));
theta

theta =

   -0.3035

theta = P1Bisect(5,0,6,3,3*sqrt(2),3,pi/4,5,6.99,3,-0.1,0.1,10^(-10));
theta

theta =

    0.0139

theta = P1Bisect(5,0,6,3,3*sqrt(2),3,pi/4,5,6.99,3,0.4,0.5,10^(-10));
theta

theta =

    0.4560

theta = P1Bisect(5,0,6,3,3*sqrt(2),3,pi/4,5,6.99,3,0.9,1,10^(-10));
theta

theta =

    0.9780

theta = P1Bisect(5,0,6,3,3*sqrt(2),3,pi/4,5,6.99,3,2.5,2.6,10^(-10));
theta

theta =

    2.5128

diary off